Re: [Dev-C++] First experience with Dev-C++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Kevin W. <ke...@me...> - 2002-01-21 14:17:29
|
Sorry, Joshua, but your code is not correct. You should not declare
variables / storage space in the argument list of a function. What do you
intend to do with 1Mb of memory? You would not be able to access the
command-line arguments.
There's nothing wrong with printf - it is ANSI compatible. If being antique
means it's considered bad style, then I'm WELL out of style (50 this year!),
but I still consider myself to be useful.
Does no one use the console program template which comes with DEV C++ ?
Kev.
---------------------------------------------------------------------------
----- Original Message -----
From: Joshua Thomas <vap...@ms...>
To: Jilani Khaldi <ji...@ti...>; <Dev...@li...>
Sent: Sunday, January 20, 2002 8:02 PM
Subject: Re: [Dev-C++] First experience with Dev-C++
printf() function is a C antique, so its considered bad style so I used cout
which conforms to ANSI standard...See notes at bottem for further comments.
Let me know if you need more help.
Joshua Thomas
// Try the code this way:
#include <iostream>
#include <stdlib.h>
int main(char * argv = new char [1024], int argc)
{
cout << "Hello Dev-C++"; //displays text in quotes... << directs the
string to cout
delete [] argv; //deletes array and pointer, so there is no memory
leak
float wait = 0;
while (wait < 1E9) //see program notes
wait++;
return 0;
}
--- snip -----
|