void CAboutDlg::OnBnClickedOk()
{
CDialogEx::OnOK();
int flag=1;
Li::flag = 2;
printf("flag = %d\n", flag);
printf("flag = %d\n", Li::flag);
cout << "flag = " << Li::flag << endl;
int *p = (int*)malloc(sizeof(int) * 10);
free(p);
int *p = new int[10];
delete[] p;
int *p = new int;
delete p;
Student stu('小明', 15, 92.5f);
Student *pp;
pp->show;
}
inline void swap(int *a, int *b) {
int temp;
temp = *a;
*a = *b;
*b = temp;
}
class Student {
public:
char *name;
int age;
float score;
void say() {
cout << name << "的年龄是" << age << ",成绩是" << score << endl;
}
};
class Student {
private:
char m_name;
const int m_len;
private:
int m_age;
float m_score;
public:
void setname(char name);
void setage(int age);
public:
void setscore(float score);
void show();
public:
Student(char m_name, int m_age, float m_score);
Student();
~Student();
virtual void display();
void Student::setname(char m_name) {
this->m_name = m_name;
};
};