
February 27th, 2005, 04:57 PM
|
 |
Renaissance Redneck
|
|
Join Date: Jan 2004
Location: Central New York. Texan via Arizona, out of his element!
|
|
|
You can read the data into a string. There is more than one 'getline.' I recommend the string class overloaded one for strings. Refer to your documentation for correct usage. I would suggest that advising your user to make sure he/she names the correct file is no substitute for checking the open operation to ensure it succeeded prior to making an attempt to read it. I would also suggest you condition your while test on a.good () as more things can happen than just end of file. Along those lines, one needs to think THOROUGHLY about WHEN eof might occur. It may occur during a gathering of data or it may occur prior to the gathering of any data. Disposition of one's storage area is at stake -- a lot of people wind up using the same datum twice or fail to properly use it once.
__________________
Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it.
DaWei on Pointers Politically Incorrect.
|