include and class instruction
hi,
I''m a little bit confused! what are the difference between :
#include <A.h> and class a; Is the first instruction can always replace the second one and vice versa?
#include"A.h"
here you include the header file (which maybe holds the class)
class a;
here you declare a class, what you need to fill like this
class a{
int x
a();
~a();
};
.....a header file is just another file filled with sourcecode.....often used to declare variables, functions, or classes.....
[edited by - pipo declown on August 15, 2002 7:52:18 AM]
here you include the header file (which maybe holds the class)
class a;
here you declare a class, what you need to fill like this
class a{
int x
a();
~a();
};
.....a header file is just another file filled with sourcecode.....often used to declare variables, functions, or classes.....
[edited by - pipo declown on August 15, 2002 7:52:18 AM]
class A; can also be a forward reference for purposes of using A in the declaration of another class:
class A; // structure declared somewhere else
class B
{
void func(A* a); // used in this definition
};
class A; // structure declared somewhere else
class B
{
void func(A* a); // used in this definition
};
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement