堆,栈,Vector存储类型,拷贝构造函数等

JeffChen » 堆,栈,Vector存储类型,拷贝构造函数等

堆,栈,Vector存储类型,拷贝构造函数等

下面四段示例程序可以说明以下概念:栈,堆, vector如何push_back, vector为什么存对象而最好不要存储指针.
对照这四段程序的输出,应该能清晰的理解以上区别.

#include "stdafx.h"
#include<vector>
#include <iostream>
原文地址:https://www.cnblogs.com/lexus/p/2874926.html