MikeYork18
06-15-2001, 02:07 AM
Say, for example, I have a file with the line
100199_12:30 25 12.50% C
I want to read this line, assign the first value, that is 100199 as a date, 12:30 as a time, and 12.50 as a double, with 25 and C as ints and chars respectively.
I've opened the file successfully, and, if I use a char array, can store both the first item and the third item, as well as assign the 25 and C to their own data types. My question is, how do I "remove" the underscore and % from those other two? Should I read them in differently? Edit the char array somehow?
Any help is greatly appreciated.
100199_12:30 25 12.50% C
I want to read this line, assign the first value, that is 100199 as a date, 12:30 as a time, and 12.50 as a double, with 25 and C as ints and chars respectively.
I've opened the file successfully, and, if I use a char array, can store both the first item and the third item, as well as assign the 25 and C to their own data types. My question is, how do I "remove" the underscore and % from those other two? Should I read them in differently? Edit the char array somehow?
Any help is greatly appreciated.