c++ - Assign values of each line of my file to an array -
this question has answer here:
- read integers text file c++ ifstream 2 answers
i have file has several lines , each lines have unknown integer values separated space characters. want assign each line's integers different lines of array. tried find example code there no.
example input file is:
1 23 4 44 12 8 10 2 66 3 22 5
maybe mean push values array of arrays.
if know number/size of vales per line, per file create statically (or allocate if not).
then read values , push them array of array.
Comments
Post a Comment