Error Spotted In Places With No Error.

Error Spotted In Places With No Error.

Expect a ';' at line 26.
Syntax Error: 'string' at line 30.
Syntax Error: ';' at line 34.
Syntax Error: missing';' before '}' at line 34.

Due t this I can not run the program and start making the contents for each of the actions that need to be performed.
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
// ConsoleApplication3.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

int main()
{

    int option{};

    std::cout << "Avalible Programs\n";
    std::cout << "1 - Average Calculator\n";
    std::cout << "2 - Basic Calculator\n";

    std::cin >> option;

    while (true)
    {

        if (option == 1)
        {
            std::cout << "You have chosen 'Average Calculator'\n";
        }

        else(option == 2)
        {
            std::cout << "You have chosen 'Basic Calculator'\n";
        }

    }

    
     
}

Last edited on
The word "string" doesn't appear a single time in the code you've shown. The error is clearly referring to a different file.

Do you have multiple projects in your solution? You're probably compiling all of them and the compiler is reporting errors in a different project.
Last edited on
Topic archived. No new replies allowed.