TheButcher
Programmer
I have to read in this file. It consists of a name, size, type, value, and address. I want to read in this file and store the different values into a structure so i can search it later in the program.
ex)
MAX 2 bytes hex 10 0000
What I am doing is reading in a line and tokenizing it by white space. I use a bunch of if else statements to determine if it is a number, type or name. Unfortunately this is not working b/c the number can be the size, value, or address. Is there any other way to read in this line. I was thinking maybe a scan b/c I know what order I will be reading in, but not all sections have to be there. Ex) They might not have an address. Ex)type could be a label, so it has no value, etc.
Thanks in advance for you help!
ex)
MAX 2 bytes hex 10 0000
What I am doing is reading in a line and tokenizing it by white space. I use a bunch of if else statements to determine if it is a number, type or name. Unfortunately this is not working b/c the number can be the size, value, or address. Is there any other way to read in this line. I was thinking maybe a scan b/c I know what order I will be reading in, but not all sections have to be there. Ex) They might not have an address. Ex)type could be a label, so it has no value, etc.
Thanks in advance for you help!