PDA

Click to See Complete Forum and Search --> : Extremely Easy


Jun 18th, 2000, 10:52 AM
This may sound easy but how do i write information from a textbox into a file.

parksie
Jun 19th, 2000, 05:04 AM
you'll have a pointer to a char array, in the usual fashion (GetWindowText).

this needs to be #included: <iostream>
also, put using namespace std; at the top of your file, directly under the includes.

to write to a file:

void mywriter(char* file, char* text) {
ofstream TheFile(file);

TheFile << text;
}


the ofstream object will be destroyed when it goes out of scope.
PS: iostream is part of the STL, one of the most useful libraries there is, and well worth a look.