On 17 Oct 2004 at 5:50, =DF =F6 R N L =EB G =EB N =D0 wrote:
> Respected Sir
> I have used Dev C++ and I want some suggestions from you. As you
> suggested me not to use the .h operator with the standard include
> files, so I did and the compiler indicated that it don't knw any
> header file named as conio. Also when I included the file iostream in
> my program, I listed using its functions of cout and endl seperately.
> I want to include stdlib and string header filesso please indicate me
> what would be the syntax of including these 2 libraries in my program.
> regards FaRAzZ
To use old C header files, use
#include <c[headerfilename]>
For example,
#include <cstdlib>
instead of
#include <stdlib.h>
To use iostream, you write:
#include <iostream>
However, to use cout and endl, you have to either put the line:
using namespace std;
OR
using std::cout;
using std::endl;
However, if I remember correctly, conio.h is not an Ansi standard
include file, it's a Borland-specific file. If you're going to use
that, you're going to have to track down someone's implementation of
that for mingw.
HTH.
Watson (the pencil neck) Davis
EXAMPLES:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <cstdlib>
#include <iostream>
// Using the whole namespace
using namespace std;
int main()
{
cout << "Hello, world" << endl;
system("pause");
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <cstdlib>
#include <iostream>
// Using just the functions we need.
using std::cout;
using std::endl;
int main()
{
cout << "Hello, world" << endl;
system("pause");
}
|