一百万个 int 多大
运行下面这段程序:
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int big[1000000];
int main() {
cout << sizeof(big) / 1000000 << "MB" << endl;
}
(本题用 g++ -std=c++17 -O0 编译。)
运行下面这段程序:
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int big[1000000];
int main() {
cout << sizeof(big) / 1000000 << "MB" << endl;
}
(本题用 g++ -std=c++17 -O0 编译。)
全部评论