Missing ; HELP!

When I compile my program it says I'm missing a semi colon before my called function Cryptencryption in line 25! Please help!!


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
void Menu()
  {
    vector<string>Original;
    vector<string>EncryptedFile;
    int decision;
    int decision2;
    int decision3;
    int key;
    int key2;
    GetfileintoVector(Original);
    cout << "Hello User! Are you encrypting(1) or decrypting(2)?" << endl;
    cin >> decision;
    if(decision == 1)
      {
      cout << "Okay! Do you want to use Rot(1) or Cryptogram(2)?" << endl;
      cin >> decision2;
      if(decision2 == 1)
        {
        cout << "What is the encryption Rot key?" << endl;
        cin >> key;
        EncryptRot(Original, key);
        }
      }
      else(decision2 == 2)
        CryptEncryption(Original);
      if(decision == 2)
        {
        cout << "Okay! Are we using Rot(1) or Cryptogram(2)?" << endl;
        cin >> decision3;
        if(decision3 == 1)
          {
          cout << "What is the decryption Rot key?" << endl;
          cin >> key2;
          DecryptRot(EncryptedFile, key2);
          }
        //      else                                                                                
          //decryptogram function                                                                   
          //}                                                                                       
        }

  }
Your brackets are out of line for the if statements. Remove them all, and re add them in the correct spots, being careful to not put an else statement with a conditional (should be else if, in that case, or just else (without the (condition)) and add the accompanying bracket on the right, as in line 24

Also, white spaces and indentation really improve readability of code with multiple nested control structures.
Last edited on
Topic archived. No new replies allowed.