This may sound easy but how do i write information from a textbox into a file.
Printable View
This may sound easy but how do i write information from a textbox into a file.
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:
the ofstream object will be destroyed when it goes out of scope.Code:void mywriter(char* file, char* text) {
ofstream TheFile(file);
TheFile << text;
}
PS: iostream is part of the STL, one of the most useful libraries there is, and well worth a look.