标签:tchar let getch [] person main on() str this
#include <stdio.h>
#include "stdafx.h"
struct Person {
public:
int age;
Person()
{
this->age = 0;
}
Person(int age);
};
Person::Person(int age)
{
this->age = age;
}
int main(int argc, char* argv[])
{
int *i = new int;
printf("*i: %d\n", *i);
delete i;
int *j = new int(5);
printf("*j: %d\n", *j);
delete j;
int *k = new int[5];
k[0] = 0;
k[1] = 1;
delete[] k;
Person *p = new Person;
printf("p->age: %d\n", p->age);
delete p;
Person *p1 = new Person(30);
printf("p1->age: %d\n", p1->age);
delete p1;
getchar();
return 0;
}
标签:tchar let getch [] person main on() str this
原文地址:http://www.cnblogs.com/roadmap99/p/6771547.html