下列语句中错误的是()。
A: int *p=new int(10);
B: int *p=new int[10];
C: int *p=new int;
D: int *p=new int[40](10);
A: int *p=new int(10);
B: int *p=new int[10];
C: int *p=new int;
D: int *p=new int[40](10);
举一反三
- 已知:int m=10;在下列语句中错误的是( ) A: int *p=new int(m); B: int *p=new int[m]={0}; C: float *p=new float(m); D: float *p=new float[m];
- 下面的new用法正确的是【 】。 A: int *p = new int(5); B: int[] p = new int(5); C: int p[] = new int(5); D: int p = new int(5);
- 下列语句中错误的是: A: int *pointer = new int(10) B: int *pointer = new int[10] C: int *pointer = new int D: int *pointer = new int[40](0)
- 动态分配包含20个元素的int型数组,下列语句中正确的是( )。 A: int *p = new int[20]; B: int *p = new int(20); C: int *p = new [20]; D: int p = new int[20];
- 下面小段程序,哪个是正确的:() A: char * p = new char[10];p[0] = 'K'; delete [] p; B: int *p = new int[25]; p[10] = 100; delete p C: char * p = new int; p = 'a'; delete p; D: int * p = new char[20];p = 'a'; delete p;