Search code examples
c++visual-studiocompiler-errorsundeclared-identifier

I get in Visual Studio C++ these errors: 'NuovoUtente': undeclared identifier and 'CercareUtente': undeclared identifier


I get in Visual Studio C++ these errors: 'NuovoUtente': undeclared identifier and 'CercareUtente': undeclared identifier

Please answer if you now why i get these errors.

This is my Code:

Code


Solution

  • Those errors look reasonable because you never defined those values anywhere in your program. From your program, it looks like you're trying to have the user enter a string and then check whether they entered a specific piece of text, but right now you're reading in a number and then comparing it against a nonexistent variable. Did you mean something like this?

    string input;
    getline(cin, input);
    
    if (input == "NuovoUtente") { // Note the == and the quotation marks
        ...
    } else if (input == "CercareUtente") {
        ...
    }