RE: [Dev-C++] New to C, New to dev cpp, New to the list
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <wa...@wa...> - 2004-02-04 23:34:22
|
On 4 Feb 2004 at 23:57, stephane weber wrote:
> Try this :
>
>
> #include <iostream>
> #include <stdlib.h>
>
> using namespace std;
>
> int main(int argc, char *argv[])
> {
> printf("hello world, i'm not the best, yet\n");
> system("PAUSE");
> return 0;
> }
Actually, if you're wanting this to be C, then it should be rewritten
like so:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("yadda yadda yadda\n");
system("pause");
return 0;
}
The mixture of C (stdlib.h) and C++ (iostream and namespaces) is not
a good thing.
If you want this to be C++, then it should be:
#include <iostream>
#include <cstdlib>
using namespace std;
// or more appropriately using std::<whatever you're using>
int main()
{
cout << "yadda yadda yadda" << endl;
system("pause");
return 0;
}
HTH.
Watson (the pencil neck) Davis
|