I'm a beginner

  • Thread starter Thread starter Jason Felix
  • Start date Start date
J

Jason Felix

What is different between #include<iostream> and #include "stdio.h"?
Why I always failed when I used the word #include<iostream> in Visual
C++.NET 2003, but I succeeded when I added the word #include "stdio.h"?
 
Jason said:
What is different between #include<iostream> and #include "stdio.h"?

You should have a space between #include and <iostream>. I'm not sure that
should matter, but it might (since you didn't elaborate on "fail").

Several differences:

1. #include <file> and #include "file" both search for and insert the
contents of the named file. using "file" will result in the directory where
the #include occurs being searched followed by the directories on the
include path, while using <file> will search only the directories on the
include path.

2. <iostream> is the header for the C++ standard stream classes, while
Why I always failed when I used the word #include<iostream> in Visual
C++.NET 2003, but I succeeded when I added the word #include
"stdio.h"?

You'd have to elaborate on "failed". Failed how? What error message(s)
appeared?

-cd
 
you forgot dot h
write
#include<iostream.h>
the different:
in iostream you have the c++ stream input/output library
in stdio you have the c standart input/output library
you can read it in the on line MSDN
 
unicorn said:
you forgot dot h
write
#include<iostream.h>
the different:
in iostream you have the c++ stream input/output library
in stdio you have the c standart input/output library
you can read it in the on line MSDN

<iostream.h> is obsolete and no longer supported (as of VC++ 7.1).
<iostream> is correct for standard-compliant C++.

-cd
 
Back
Top