0

I am getting a "misplaced break" error from this part of the code,the following is a part of the mfile function,the while loop should break if the entered string in temp equals to the one in exit....I don't know why it shouldn't work,any help?Thanks.

ofstream myfile;
	myfile.open(fn,ios::ate);
	cout<<"File has been created. You may write to it now\n(enter '\esc' without inverted comma to close file).\n";
	char exit[4]="\esc";
	while(1);
	{
		char temp[600];
		gets(temp);
		if(strcmp(temp,exit)!=0)
		      [B]break;[/B]
		myfile<<temp;

	}
	myfile.close();
	mainmnu();

}
2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by anu07
0

oh gosh!! thanks a lot LZSqr,what a stupid mistake I made,thanks. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.