Lil'Hasher
February 13th, 2003, 09:19 AM
Hello,
I'm trying to read a record in from a file. I have a record class with char* for two fields, name and last name say. However when overloading the >> operator so that i can read from a file dircetly into a record objec, i run into this problem :
I have two files of two slightly different formats, I would like to be able to read into a class record object from both those formats.
So is there a way to overload the << operator twice and somehow distinguish which is for which file?
ie. File 1 : Last Name [6 characters of blanks] First Name
File 2 : Last Name First Name (with no spaces)
thanks
I'm trying to read a record in from a file. I have a record class with char* for two fields, name and last name say. However when overloading the >> operator so that i can read from a file dircetly into a record objec, i run into this problem :
I have two files of two slightly different formats, I would like to be able to read into a class record object from both those formats.
So is there a way to overload the << operator twice and somehow distinguish which is for which file?
ie. File 1 : Last Name [6 characters of blanks] First Name
File 2 : Last Name First Name (with no spaces)
thanks