When I mut write <iostream.h> and when I must write <iostream>

I want know when I mut write <iostream.h> and when I must write <iostream> and what's the difference please
Last edited on
you must write only <iostream>..... <iostream> is the correct name of the header file
Last edited on
thanks and can you answer me on this question ?? please :
What the target from writing : ( using namespace std; ) and I want to know a link for the books who are talk about the graphical designing in c++ I mean the forms and the controls because I don't love console projects
Last edited on
you don't need to write the "std::" to all the standard types (like cout, cin, endl)

eg.

without "using namespace std;"
1
2
3
4
5
6
#include <iostream>

int main() {
   std::cout << "Hello World!" << std::endl;
   return 0;
}



with the "using namespace std;"
1
2
3
4
5
6
7
#include <iostream>
using namespace std;

int main() {
   cout << "Hello World!" << endl;
   return 0;
}


Advice: dont use "using namespace std;"
Last edited on
If u put <iostream.h> you w0nt be needed the std: ... Ex. Putting c0ut using iostream
std::cout<<"hello world";
In iostream.h
cout<<"hello world"; getz?

Advice: dont use "using namespace std;"

Why ?
I want to know links for the books who are talk about the graphical designing in c++ I mean the forms and the controls because I don't love console projects please
Why ?


In time the namespace std will be useless since he may use other namespaces, using <the namespace>::<the element from that namespace> its a good thing
I want to know links for the books who are talk about the graphical designing in c++ I mean the forms and the controls because I don't love console projects please
look up wxWidgets

http://www.wxwidgets.org

They have online tutorials, the API is pretty well documented, there's a forum for help, and there are even books for sale.

Some would say that jumping into GUI programming without first having a firm understanding of C++ basics is a recipe for disaster. I think that's hogwash, though... I didn't have any trouble using MFC when I first started.
See what's in iostream.h
1
2
3
4
5
6
7
#include <iostream>
// ...
using std::cout;
using std::cin;
using std::cerr;
using std::clog;
// ... 

But you just pollute the global namespace with more stuff...

My point is: take the time and energy to spell things out unless you have really good excuses
Last edited on
If you use only the standard library there's nothing wrong in using namespace std;,
If you are using multiple libraries but you have to use a symbol really often, using a_namespace::symbol; is better than typing a_namespace::symbol every time
I will take this moment to state my absolute hatred for using.
Topic archived. No new replies allowed.