#include<iostream>
using namespace std;
class item{
int a,b;
void getdata(int x,int y){
x=a;
y=b;
}
public:
void here(int a,int b)
{
void getdata();
}
void display();
};
void display()
{
printf("a is %d",a);
printf("\nb is %d ",b);
}
int main()
{
item A;
A.here(10,20);
A.display();
}
Errors a and b are not declared in this scope for display function.
I cant also acces private function i.e void getdata(int,int) with a object without a public method, Right???