|
From: Per W. <pw...@ia...> - 2003-08-17 11:34:11
|
Why bother about the most portable single-line solution?
When I develop a console app, I want it to behave as a console app, i.e.
not require some extra input in the end.
I add the system("pause"); command during testing, just to allow the
program to be run from the editor. When I stop compiling with debug, I
don't want the pause anymore.
For a portable solution, the code should try and figure out if it was run
from the command line or from the desktop.
/Per W
On Sun, 17 Aug 2003, Hossein Haeri wrote:
> Dear Alireza (or Alex, don't know which!),
>
> Amongst all the group-given solutions to your problem, the most
> portable is to use std::cin. (I presume that you are using C++,
> and not C.) Use it this way:
>
> #include <iostream>
>
> int main()
> {
> ...
> cin.get();//The last line of main() body
> }
>
> Regards,
> --Hossein
>
> --
> __________________________________________________________
> Sign-up for your own personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
> CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
> http://corp.mail.com/careers
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|