PDA

Click to See Complete Forum and Search --> : Please help - File I/O


limmies1
Sep 8th, 2000, 07:16 PM
I have a file of the following type:

text1.txt
1
text2.txt
20

how do I make it such that it will read the 'text.txt' as 'text' and the numbers as integers.

andrew

parksie
Sep 9th, 2000, 11:19 AM
You have to read each line as a string. However, once you've loaded it, then you can use functions like atoi to convert them to an integer.