• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Why it skipped?

GiLtY

Golden Member
Hi i need help again in C++(i know i need a lot of help 😉)
I was doing this class inplementation thing, one part where i need to record some characters. So in the member function i just use:
cout<<endl<<&quot;Enter your message: &quot;;
cin.get(Greeting,200);
cin.ignore(200,'\n');
Write.open(&quot;asdf.txt&quot;, ios:: out);
Write<<Greeting;
Write.close();

i thought the character array (which i already declared in the private area) will record what user typed in. Well, it got out of control, the program skipped the step and goes to the next cout statment after the codes above. Why did it skip?!?!?! I tried to use the same code in my client program, the same thing happened. But when i made a new program, with just the codes and some declaration of the Write and Greeting, it didn't skip! :Q can someone explain it to me why it happens and how can i fix it? Thanx
 
Back
Top