Can anybody hepl?

This is a discussion on Can anybody hepl? within the C++ Programming forums, part of the General Programming Boards category; are there any problems for these? void empArray::read () { return data_io::read (emplist, &inx); /* fstream data_file; int count = ...

  1. #1
    Unregistered
    Guest

    Unhappy Can anybody hepl?

    are there any problems for these?

    void empArray::read () {

    return data_io::read (emplist, &inx);
    /* fstream data_file;

    int count = 0;
    int i = 0;
    char type;

    Temp *t;
    PTime *p;
    nonExempt *n;
    Exempt *x;
    Management *m;

    data_file.open ("Employee.dat", ios::in | ios::binary);

    inx= 0;
    while (!data_file.eof()) {
    data_file.read (&type, 1);
    switch (type) {
    case 'M':
    m = new Management;
    data_file.read ((char*) m, sizeof (Management));
    emplist[inx] = (Employee*) m;
    (inx) ++;
    count ++;
    break;

    default:
    break;
    }
    }
    data_file.close();*/
    }



    Thx.
    J

  2. #2
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    The first thing i see is you have a return at the top of the function before any code so everything after that is ignored.
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >are there any problems for these?
    What does your compiler say? Does it work when you test it? Do you think this is your all purpose debugging with no work forum? At least attempt to figure it out on your own or you'll never learn anything.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21