Member Avatar

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;,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";
		char temp[600];



Recommended Answers

All 2 Replies

while(1); Drop the semicolon. ( while(1) )

Member Avatar

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.