Re: Fw: [Dev-C++] First experience with Dev-C++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luigi S. <gi...@li...> - 2002-01-22 14:08:01
|
Hello list,
Consider me as a newbie, I just know (or think to know) a few elementary
things about C (I mean "antique" ANSI C-89).
According to two recent posts, I received from this list, the following
code (by Jilani Khaldi) does not work:
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello Dev-C++");
return 0;
}
While the following (by Joshua Thomas) is a working version of it:
#include <iostream>
#include <stdlib.h>
int main(char * argv = new char [1024], int argc)
{
cout << "Hello Dev-C++";
delete [] argv;
float wait = 0;
while (wait < 1E9) //see program notes
wait++;
return 0;
}
Excluding the "float wait" stuff (not required if one runs applications
from the command line), I'm a little confused:
- is the second version written in "modern" ANSI C-98 (hope the year is
right)?
- what need is there to include "stdlib.h"?
- is the order of the parameters correct in the first or in the second version?
I would be glad to hear a word from someone.
TIA.
At 13:06 21/01/02 -0500, Joshua Thomas wrote:
>
> From: Joshua Thomas
> Sent: Monday, January 21, 2002 1:03 PM
> To: Kevin Wood
> Subject: Re: [Dev-C++] First experience with Dev-C++
>I agree with you on making arguments in main function for storage array a
>bad idea. I was presenting a working code that fixed what didn't work in
>his. If you compile the code he sent it doesn't compile without errors.
>Using printf() is still bad style. No reason to use it except because you
>can:) Cout does the job with less junkie looking code...
>Joshua Thomas
>
--
Luigi
gi...@li...
|