-
January 22nd, 2010, 09:38 AM
#1
"cout <<" Problem???
<code>
Object M
string computer;
getline(cin, computer);
cout << "Input Accepted...";
if (computer == "") {
cout << "Initializing List Mode...\n";
M.run();
} else {
M.do(computer);
}
</code>
When I run my code it will do "do" or "run" and print out "Input Accepted" afterwards. I'm not understanding why?? Thanks for any help.
O and completely guessed on how to mark code so hope that's right.
-
January 22nd, 2010, 10:01 AM
#2
Re: "cout <<" Problem???
use [] around the code word.
Try this:
Code:
cout << "Initializing List Mode..." << std::endl;
This will flush the stream cout and print immediately what you streamed to it so far. If you do not flush the stream, its content will get buffered and printed later, which in your case may be at the end of your application.
-
January 22nd, 2010, 10:07 AM
#3
Re: "cout <<" Problem???
Originally Posted by TommyFeticini
O and completely guessed on how to mark code so hope that's right.
no worries you can edit your post using the edit button on that post. the correct tags are [CODE]code here[/CODE]
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|