Monkeyanator
Monkeyanator

Reputation: 1416

How do I save user information (like NSUserDefaults in obj-c) with C++?

In objective-c it's easy. Although, in C, you have to call fopen, read, close and all of that jazz. How do you do it in C++?

Upvotes: 0

Views: 499

Answers (1)

Code Monkey
Code Monkey

Reputation: 319

just use the header fstream example:

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
ofstream file;
file.open("file.txt");
file << "Test!\n";
file.close()
return 0;
}

Upvotes: 3

Related Questions