Hello.
I am making a program for adding text to a file and more.
I get this error code: "expected primary-expression before 'else'" and "expected ';' before 'else'" at these rows in a loop:
1 2 3 4 5 6
do {
cin >> yn;
if (yn=="y") {makefile(); cout << "Creating the file " << filename; looperthingy=true;}
elseif (yn=="n") {cout << "Answer is No, cancelling program."; looperthingy=true; entergo=false;} //Error at this row
else cout << "Please write y or n.\n"; //And this row
} while (looperthingy==false);
isnork, no, cause that is just one command/function/whateveryouwannacallit and that don't need braces... OH i found the problem...
i added a ; too much in the code but it (somehow) didn't make it to the site...
line 3 if (yn=="y") {makefile(); cout << "Creating the file " << filename; looperthingy=true;}; //THERE<<<
I am sorry for taking up place in the forums :)