can anyone give me the idea how can i sort out the data types from a text file. let suppose i have a txt file contain
i want to store integers in seprate variables of int type let suppose an int array. and stings in some char array. double in double type array and so on. i mean i want to sort the data from that file. please give me any help or ideas . i shall be thanks full to you all
i am new in C++ my knowledge about file stream as under
i know basics of opening txt file read and wrtie data from it. seekp() seekg() and tellp tellg fucntions. and all ios:: directives.
did't understand , you mean to initialize all type of arrays like int double char etc then read the file with delimiter, but how can reader sort the type into correct array? means if i read this line
how can reader put 256 into int array and cars into char?
let me clear you that i don't know what the txt file have in it.
there might be this line
or might be
we don't know the orders of words which come first. i want to get an idea how the file-reader justify which type of word he is reading and in which data type he needs to store it