请教一个关于delete的用法的错误
char *depart = “Computer Science”;
char *univ = “
strcpy(depart, univ);
cout << “Department of ” << univ << endl;
delete depart;
delete univ;
是没有语法错误 但是好像不是正确的阿 还有这个〉。。
const int len = 80;
char *errorMsg = new char[len + 1];
char *promptMsg = new char[len + 1];
strcpy(errorMsg, “Character pointer error.\n”);
promptMsg = errorMsg;
cout << promptMsg << endl;
delete promptMsg;
delete errorMsg;
[此贴子已经被作者于2006-3-5 16:50:55编辑过]