[英]How to delete an array of char* in C++
I looked around the web for this but I did not find an answer.我在网上环顾四周,但没有找到答案。 If my class has a protected member declared as such: char * arr[3] = {"Blah", "Blah", "Blah"}
Would I need to delete this member in the destructor?如果我的班级有一个受保护的成员声明如下: char * arr[3] = {"Blah", "Blah", "Blah"}
我是否需要在析构函数中删除这个成员? If so, what is the correct syntax?如果是这样,正确的语法是什么? Thank you!谢谢!
Would I need to delete this member in the destructor?我需要在析构函数中删除这个成员吗?
No.不。
And of course:而且当然:
I can't use the string class, it's a programming assignment and they want all strings to be stored as char*我不能使用字符串类,这是一个编程任务,他们希望所有字符串都存储为 char*
This is a quite silly restriction in a C++ assignment.这是 C++ 赋值中一个非常愚蠢的限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.