cppdatabase.cc
changeset 169 df7c720bcaa6
parent 94 c100ba6939e3
equal deleted inserted replaced
168:dfb60716880c 169:df7c720bcaa6
    28     in.clear ();
    28     in.clear ();
    29     in.seekg (0, std::ios::beg);
    29     in.seekg (0, std::ios::beg);
    30 
    30 
    31     struct Person p;
    31     struct Person p;
    32 
    32 
    33     while ((in.read ((char *)&p, sizeof (Person))) != NULL) {
    33     while ((in.read ((char *)&p, sizeof (Person))) != 0) {
    34         std::cout << p.lastname << ", " << p.firstname << ", " <<
    34         std::cout << p.lastname << ", " << p.firstname << ", " <<
    35             p.position << std::endl;
    35             p.position << std::endl;
    36     }
    36     }
    37 }
    37 }
    38 
    38