I have a doubt regarding forwarding declaration.
in .h file:
class B;
class A{
void func(B* tap);
}
in .cpp file
void A::func(B* tap){
tmpo=tap->par1;
}
does the above code snipet correct if not whats the problem. Please be descriptive.
|
Go4Expert Founder
|
![]() |
| 1Apr2009,16:12 | #2 |
|
In .cpp file I assume you have included the .h file and if that is true its correct but then tmpo and other variables are in doubt
|
|
Pro contributor
|
![]() |
| 1Apr2009,16:19 | #3 |
|
You need have to include the .h file for declaration for class A in the file where "class B" declaration is there.
Apart from that tempo is what here? |
|
Newbie Member
|
|
| 1Apr2009,16:38 | #4 |
|
I got my doubt clear. I have to include B.h file in A.cpp file as earlier i was in a doubt since i already had made forward declaration of B in A's header file.
tempo is nothing imp. here....just a part of rough-code. btw, thanks 4 clearing my doubt. |


