有关类中数据成员赋值的问题
#include <iostream>using namespace std;
class Person{
private:
int a = 10;
public:
void display(){
cout<<"a="<<a<<endl;
}
};
int main(){
Person p;
p.display();
return 0;
}//这样的赋值在vs2015上居然能通过编译并运行。
2015-12-08 22:47
2015-12-09 09:39
2015-12-10 00:09
2015-12-10 09:10
2015-12-10 14:26
2015-12-10 15:59
2015-12-11 03:24