Wednesday, January 29, 2020

CPP: Write to a file using ofstream



To build:
$: clang++ ofstream.cpp

Run it:
$: ./a.out

Read the file:
$: cat file.txt

No comments:

CPP Quick Guide

Basics Hello world User input While loop If statement For loop Switch statement Read file using ifstream Write to a file using ofstr...