A
asdf
Members defined in the private section are accessible to other class
members. So, I think the following is correct.
#include<iostream>
using namespace std;
class A{
int x;
public:
int get(x) {return 1;};
};
int main()
{
return 0;
}
However, there is a syntax error : identifier 'x'
what's the reason? the private member cannot be the parameter of the
public function?
members. So, I think the following is correct.
#include<iostream>
using namespace std;
class A{
int x;
public:
int get(x) {return 1;};
};
int main()
{
return 0;
}
However, there is a syntax error : identifier 'x'
what's the reason? the private member cannot be the parameter of the
public function?