RE: [Dev-C++] wait, i might have something
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-04-12 18:32:11
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Kenneth Armstrong
> Sent: Friday, April 12, 2002 6:37 PM
> To: dev...@so...
> Subject: [Dev-C++] wait, i might have something
>
>
> well i tried something different. in the console programs
> that i was trying
> to run in a dos window, i set up something like this:
>
> int main()
> {
> // code
> return 0;
> }
>
> that type of program would flash on and off, so it was
> impossible to use it.
> but then i tried this:
>
> void main()
> {
> //code
> }
>
> and that particular program did not flash on and off. it
> stayed on the
> screen. but i thought that using void in the main function
> was considered
> bad programming etiqutte and that you should always try to
> return a value to
> the operating system. what's the deal?
Yes and the void thing has nothing to do with the non-pausing. The
pausing is bypassed by '\n's (enters) which remain in the stream
probably after scanfs or cins in C++.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|