#include <vector>
#include <iostream>
int main() {
size_t bytes = 1024 * 1024; // 1MB = 1,048,576 bytes
std::vector<char> buffer(bytes, 0);
// Use the memory
buffer[0] = 'Z';
// No need to manually free memory; vector handles it automatically
std::cout << "Memory allocated and initialized successfully.\n";
}
/*
run:
Memory allocated and initialized successfully.
*/