RE: [Dev-C++] Help me with debugging pls.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ramana K. <ra...@my...> - 2002-08-05 11:31:06
|
Just one comment, Ioannis, writing the following:
using namespace std;
completely defeats the purpose of namespaces, as it just includes everything
within the std namespace, including those things that are not needed.
Instead, I suggest writing:
using std::cout;
using std::system;
//etc
at the top of whichever file needs these functions.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Ioannis
Vranos
Sent: Thursday, 1 August 2002 7:37 PM
To: dev...@li...
Subject: RE: [Dev-C++] Help me with debugging pls.
I do not know the GDB thing but i have to make your code ANSI C++ compliant.
:)
Ioannis
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Vaclav
Kremen
Sent: Wednesday, July 31, 2002 5:44 PM
To: dev...@li...
Subject: [Dev-C++] Help me with debugging pls.
Hello all,
here is my short code:
#include <iostream.h>
#include <iostream>
#include <stdio.h>
Or better: #include <cstdio>
#include <stdlib.h>
Or better: #include <cstdlib>
int main (int argc, char *argv[])
{
int argc, char *argv[] are not used, so they are not needed.
using namespace std;
int x = 1000;
x = x*x;
cout << "Hello World!" << endl;
x = 1;
cout << "Press ENTER to continue... " << x <<endl;
getchar ();
or better: cin.ignore(); So <cstdio> is not needed.
return 0;
}
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|