I made a function in, let's say class X like so. In the X.h I typed:
void func();
In X.cpp
void X::func(){}
And I want to use func(); in class Y, in a method specifically within class Y, but when I do
1 2 3
|
#include "X.h"
//...
func();
|
Then it will say func(); is undefined. How do I call a function from one class into another? (I have added #include "Y.h" in class X)
Last edited on