无论是int 还是 char 初始化方式都是一样
(指定初始值或者用指针指向所开辟的内存)
int num[] = {1,22,333};
int *p = num;
int *num2 = new int[3];
char c[] = {‘aaa‘,‘a‘};
char *cp = c;
char *cArr = new char[2];
时间: 2024-10-06 05:39:29
无论是int 还是 char 初始化方式都是一样
(指定初始值或者用指针指向所开辟的内存)
int num[] = {1,22,333};
int *p = num;
int *num2 = new int[3];
char c[] = {‘aaa‘,‘a‘};
char *cp = c;
char *cArr = new char[2];