URGENT - Variable length records
Posted on 1998-05-05
I need some help please.
I am reading a comma delimited file using the ifstream class. Many fields are variable so I am using m_file.getline(a,80,","); to read the entry. with a being previously defined as char a; This is not a problem and seems to work ok. The problem is when I read the records the data is not being nulled when I do another read. I have tried a=NULL, a=NULL to no avail.
So my question is: if I decalre a variable with char a how do I ensure that it is set to null after each read/processing cycle so that processing of further records is not interfered with because of trash data?
Am I using the correct variable type? or is there a better way to do this?
Hope you can help.