|
-
February 13th, 2003, 10:19 AM
#1
Operator Overloading
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|