Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


C + + header file on the issue

Two days ago I read a definition of the order of postings on the first document, but can not find one, and I like it, the first definition of this document
#include "Iostream>
Using namespace std;
The first paper on the definition of the order to decide whether the success of the translation process, a day when we wrote the teacher in the class procedures 114,800 illnesses, the head of the order paper for a statement about the results through translation, in the end this is to ask, what principle? I understand the above document is not the first good, experts advise

For example, ah bh first paper in the front,
Ah included in a defined type variable b bh.
When you translated at the main function will be incorrect report, because it Compiler
Where no definition of the type b variables. It will not be able to find the translation.
A simple example :
A.h
[code]
#ifndef _A_H_
# _A_H_
Struct a{
Struct bb;
}
#endif
[/code]
B.h
[code]
#ifndef _B_H_
# _B_H_
Struct b{
Int c;
Long l;
}
#endif
[/code]
Main.c
[code]
#inclue "Ah"
#include "Bh"

Int
Main ()
{
Struct aa;
Return 0
}
[/code]
The translation will be incorrect report.
After the order if the documents for a period, no problem.
In fact, the solution is to add the previous document ah
#include "Bh"
The order of succession so that they would not have to rely on a relationship.

I know you said this, I would like to ask if this remark,
#include<iostream>
Using namespace std;
#include<stdio.h>
Type in the category. H header files, most of which were
#include<iostream>
Using namespace std;
Ahead or behind, this seems to have provided the

-->
No requirements.
White is so much to say. : (

If the yes. H
Would not invoke the name space

House hufenghuanyu reply to the message

Generally using C + + namespace Std first on the final document, but is best not to use too many things because of exposure to the process, what would write what became the

-->
Not saying that we should not using namespace Std the vs2005, cin, cout not rigidly?



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com