#include <iostream>
using namespace std;
class All
{
public:
void set_age(int x){age=x;}
int aage(){return age;}
private:
int age;
};
int main()
{
All Tom;
Tom.set_age(25);
cout<<endl;
Tom.aage();
return 0;
}
为什么输出不了25????
...全文
1176打赏收藏
请教下,最基本的问题
#include using namespace std; class All { public: void set_age(int x){age=x;} int aage(){return age;} private: int age; }; int main() { All Tom; Tom.set_age(25); cout<<endl; Tom.aage(); return 0; } 为什么输出不了25????