Relative Content

Tag Archive for c++fstream

invoke destructor manually

int x; // ok, done with it // how do I destroy var. x manually? // then reuse name float x; How do I destroy variables manually and use same var. name in same scope? My actual situation look more like this: std::ofstream output; // do stuff output.close(); // at this point I need to […]

writing double** matrix to a binary file?

I have a 2d array matrix defined as double** map. The size is num_columns * num_rows.
How can I use fstream to copy the data to a binary file? can it be done at once?

C++ append to file

int main(){ fstream plik; plik.open(“dane.txt”, ios::out); plik << “Aaaaan”; plik << “Aaaaa”; plik.close(); plik.open(“dane.txt”, ios::in); while(!plik.eof()){ string linia; plik >> linia; cout << linia << ” “; } plik.close(); plik.open(“dane.txt”, ios::out); plik << “Baaaa”; } i wanted to add text to an already created file, dunno why but append isnt working or im doing smth […]