Results 1 to 2 of 2

Thread: Extremely Easy

  1. #1
    Guest
    This may sound easy but how do i write information from a textbox into a file.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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:
    Code:
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width