#include<iostream>
using namespace std;
class my{
int a;
int b;
friend my func2(int x, int y);
public:
void func1(void){
cout<<"Enter a number "<<endl;
cin >> a;
cout<<"Enter another number "<<endl;
cin >> b;
}
};
my func2(int x, int y){
int h=x+y;
return h;
}
int main(){
my n;
n.func1();
int z= func2(n.a,n.b);
cout<<z;
}``` I cant understand the error in compling time plese explain i am new in c++
#Getting a error in class idk why
1 messages · Page 1 of 1 (latest)
<@&987246683568103514> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.