Reputation: 133
In the following C++ function:
void save_data(std::ofstream& csv) {
csv << "a message";
}
Something I don't understand: if save_data
is called, where does it
write to? To a file? How exactly is it used?
Upvotes: 1
Views: 369
Reputation: 264471
An ofstream
represents a file on the file system:
int main()
{
ofstream file("Plop.txt");
save_data(file);
}
Upvotes: 3