Hello. I am having a problem with a program I am making. It won't compile. Can somebody look at it and see what I am doing wrong? (it says that there is a problem with the for loop)
Code:
#include <cstdlib>
#include <iostream>
#include <string>
#include <windows.h>
#include <fstream>
using namespace std;
int mainmenu () {
cout<< "Welcome to the NaNoWriMo Notepad!\nHave fun!\n";
cout<< "\nMAIN MENU\n 1 Create a New Project\n 2 Open a Project\n 3 quit\n\n";
int mainmenu;
cin>> mainmenu;
return(mainmenu);
}
void create () {
cout<< "What is your project's name (you can't change this later) (hint: you need to rememer this, so call it the year): ";
char filename[20];
cin>> filename;
cout<< "\nYour file is called " << filename << "\n";
cout<< "Your file is now being created.\n";
ofstream Project(filename, ios::out);
}
int main(int argc, char *argv[])
{
ofstream fout;
system("color 02");
SetConsoleTitle("NaNoWriMo Notepad");
for(,,) {
int menu;
menu = mainmenu();
if(menu == 1) {
create ();
}
else if(menu == 2) {
char myfile[20];
cout<< "Enter the name of your file (the year): ";
cin>> myfile;
}
else if(menu == 3) {
system("exit");
}
}
cout<<"Hello World!\n";
string test;
getline( cin, test );
cout<< test;
system("PAUSE");
return EXIT_SUCCESS;
}
Thanks