this is a quick program that I threw together, i hope this helps in some way...
Code:
#include <iostream>
#include <stdlib.h>
#include <fstream>
using namespace std;
char str[256];
int main(int argc, char *argv[])
{
cout << "Please enter a string (maximum of 256 chars):" << endl;
cin.getline ( str,256, '\n' );
ofstream a_file("test.ini");
a_file << str;
a_file.close();
cout << "This is what is contained in the file test.ini:" << endl;
cout << "" << endl;
std::ifstream b_file("test.ini");
std::cout << str;
cout << "" << endl;
b_file.close();
system("PAUSE");
return 0;
}