It is currently Tue, 30 Nov 2021 17:34:43 GMT



 
Author Message
 retrieve record from record file(binary) to output to disply, need help
Dear linux programmers(c/c++):

  I use following subsetion of my programs to try to retrieve the
record(some string variable cusnumber, from a record(binary) file,
but I get nothing (NULL of that string) at outfile(either display or
outfile)
I uses djgpp compiler with the book of c++(Liberty, sam , white) on
window98

  Please help, welcome any tech suggestions, sincere eric,
fs...@centurytel.net

---------------------------------------------------------------------------

  ifstream CustomerInFile("CustomerFile.fil",ios::binary|ios::nocreate);

      // CustomerInFile.read((char  *) &customer, sizeof(customer));
    outfile.open("cusrep.txt");
        outfile << " Customer number, Customer name, Address, City,
State,dateofbirth, PhoneNumber, Balance\n";

        //while (  CustomerInFile.read((char  *) &customer, sizeof(customer))
        while ((CustomerInFile))
         {

                 CustomerInFile.read((char *) &customer, sizeof(customer));

                  //cout << " Customer number, Customer name, Address, City,
//State,dateofbirth, PhoneNumber, Balance\n";
                    *cusnumber = *customer.cusnumber;

CustomerInFile.get(cusnumber, 6);

         outfile  << customer.cusnumber;
         cout << cusnumber << "-------cusnumber\n";



 Sun, 26 Sep 2004 16:16:02 GMT   
 
   [ 1 post ] 

Similar Threads

1. c/c++ record output, need help

2. Redirect of sql statement output and record length of a file

3. delete last record in binary file on UNIX

4. delete last record in a binary file

5. Retrieving record lengths

6. dd: x records in and x records out

7. Convert a big record into chunks of small records

8. Fixed length records containing 2 different records types with fixed field widths

9. Record by record


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software