Hello ,
I am learning about how to create .h files.If there is a program and it has one class in it and member functions in it.I know we include all the declaration of the class in the .h file of that program.And for example we have declared many other variables in the body of the member functions .Do do we have to include those variables of member functions in the .h file of that program or just the declaration of the member fucntions and variables of the class.
I will be glad if someone tells me this.
Thank you !
I'm not sure I understand, but if you mean variables local to the function, then no you do not need to do anything special in the header file for them.
Header:
1 2 3 4
class C {
int a;
void func(int, int, char);
}
Source:
1 2 3 4 5 6
void C::func(int a, int b, char c) {
a = b;
char v; // "variable in the body of the member function"?
v = c;
return;
}