我有兩個代碼塊約new[]和delete[]: 1) #include <string>
int main()
{
std::string *p = new std::string[0];
delete[] p;
return 0;
}
2)在這種情況下,我僅改變std::string到int int main()
{
int *p = ne
後 可能重複: C++ delete - It deletes my objects but I can still access the data? 考慮下面的代碼: - #include <iostream>
class Test
{
public:
int k=10;
};
int main(int argc, const char * argv[])
{