samedi 20 juin 2020

why does int myVar {5} give an error and not work?

i am taking a c++ course and the instructor said to make variables like this:

int main() {
    int myVar {5};
    return 0;
}

this gives me an error: "expected ";" at the end of declaration"

what is wrong?

Aucun commentaire:

Enregistrer un commentaire