char* p = new char[65];对应的释放内存的语句是:
A: free p;
B: delete *p;
C: delete [] p;
D: delete p[];
A: free p;
B: delete *p;
C: delete [] p;
D: delete p[];
举一反三
- char* p = new char(32);释放内存的语句是: A: delete [] p; B: free(p) C: delete p; D: delete <char> p;
- char* p = new char(32);释放内存的语句是: A: delete [] p; B: free(p) C: delete p; D: delete <char> p;
- char* p = new char(32);释放内存的语句是: A: delete &p; B: delete *p; C: delete [] p; D: delete <char> p;
- 下面小段程序,哪个是正确的:() 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;
- 以下关于数组动态分配与释放内存的正确代码是 A: int p[100] = new int[100] 和 delete p B: int *p = new int(100) 和 delete p C: int *p = new int[100] 和 delete []p D: int *p = new int(100) 和 delete []p