C++内存管理7-Vector申请最大内存

 
struct ET
{
    int a;
    double b;
    int arr[10];
};


int main()
{
    std::cout << "Hello World!\n"; 
    std::vector<double> douVector;
    cout << douVector.max_size() << std::endl;

    ET et;
    cout << "ET size:" << sizeof(et) << endl;
    std::vector<ET> etVector;
    cout << etVector.max_size() << std::endl;


    int a = 536870911;


    system("pause");

}

  在64位程序输出:

 

在32位程序输出:

猜你喜欢

转载自www.cnblogs.com/icmzn/p/11827421.html
今日推荐