D
da Vinci
Hello.
First off, I am not sure of the exact jargon used, so I will ask a
question regarding it. Then on to my other question.
When you use things like cout and cin from the iostream header file,
what are those called? Is cout and cin functions? What is the proper
term for them a command listed in a header file? Or is it just a
"command"?
My next question.....
We use a Deitel book in my C++ class. All of their sample code in the
book shows that they use the following format for including header
files and using the "term from above" contained in them.
#include <iostream>
using std::cout;
using std::cin;
I have also seen it in other places as
#include <iostream>
using namespace std;
What I have always done, and what my teacher says is a carry over from
C, is this....
#include <iostream.h>
so that none of the using commands are needed. When your using quite a
few header files, those using statements get a bit cumbersome.
So, what is the "proper" way to do it? I am sure everyone has their
own way of doing it and likes to stick to their way. What are the
rewards or benifits from doing it each way? Are there any or is it
strictly personal taste?
Thanks in advance for any ideas.
DV
First off, I am not sure of the exact jargon used, so I will ask a
question regarding it. Then on to my other question.
When you use things like cout and cin from the iostream header file,
what are those called? Is cout and cin functions? What is the proper
term for them a command listed in a header file? Or is it just a
"command"?
My next question.....
We use a Deitel book in my C++ class. All of their sample code in the
book shows that they use the following format for including header
files and using the "term from above" contained in them.
#include <iostream>
using std::cout;
using std::cin;
I have also seen it in other places as
#include <iostream>
using namespace std;
What I have always done, and what my teacher says is a carry over from
C, is this....
#include <iostream.h>
so that none of the using commands are needed. When your using quite a
few header files, those using statements get a bit cumbersome.
So, what is the "proper" way to do it? I am sure everyone has their
own way of doing it and likes to stick to their way. What are the
rewards or benifits from doing it each way? Are there any or is it
strictly personal taste?
Thanks in advance for any ideas.
DV