为什么调用了vector的clear()还是能正常输出数据?
在学习C++的vector的时候意外地碰到了一个问题:
class Box {
private:
int length;
int width;
int height;
public:
Box(int length, int width, int height) : length(length), width(width), height(height) {}
void show() {
cout << "length : " <&
原创
2022-03-05 17:12:33 ·
416 阅读 ·
0 评论