Exercise

Started by
10 comments, last by sevak 20 years, 8 months ago
You forgot a < when writing system("PAUSE");

Scott Simontis
If it wasn''t for C, we''d be using BASI, PASAL and OBOL
Scott SimontisMy political blog
Advertisement
quote:Original post by Village Specialton
You forgot a < when writing system("PAUSE");

Scott Simontis
If it wasn't for C, we'd be using BASI, PASAL and OBOL

The break in the code is merely as a result of the forum interpreting the angle bracket as part of an HTML tag. If you click on the 'Edit' or 'Quote' button you can view the actual post body.

I assume from your post that you meant that the OP should be using system() like so:

std::cout << "..." << system("PAUSE");

Although this is valid (it does not cause a compile-time error), it will not work as you most likely desire it to. system() returns an int, representing the type of success or failure of the invocation. Using it as so will pass the integer returned by system() to std::ostream's overloaded left-shift operator method, that is you will be printing this value to the standard output. This is probably not what you intended to do, so you would do something along the lines of this:

std::cout << "..." << std::endl;
system("PAUSE");

[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || MSVC++ Library Fixes || BarrysWorld || E-Mail Me ]

[edited by - Lektrix on August 9, 2003 2:10:23 PM]
[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || CUJ || MSVC++ Library Fixes || BarrysWorld || [email=lektrix@barrysworld.com]E-Mail Me[/email] ]

This topic is closed to new replies.

Advertisement