VirtualBox

Ticket #18805: test.cpp

File test.cpp, 342 bytes (added by AndresPlazaR, 5 years ago)

Example code for this problem.

Line 
1#include <fstream>
2#include <iostream>
3#include <sstream>
4#include <string>
5
6using namespace std;
7
8int main(int argc, char* argv[]) {
9 string filename = "test.out";
10 string message;
11 for (int i=0; i < 1024; i++) {
12 message += "a";
13 }
14
15 ofstream outfile;
16 outfile.open(filename);
17 outfile << message;
18 outfile.close();
19}

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy