Hi!! i dont know if you guys can help me
i have a file "numbers.txt" which have the format.
1,4,7,19,20
5,7,10,15,17
5,11,12,16,18
4,7,12,14,16
1,2,7,10,14
7,9,10,15,18
3,7,8,9,14
3,9,11,13,19
1,2,5,12,15
i want to get all the number and store them into a vector.
i've tried using a stream eg.
string cash_num ;
while (inputfile1>>cash_num){
// *CODE*
}
also i tried declaring cash_num as char as well as int
but nothing works. the commas are posing a problem.
is there anyother clever way to do this?
thanks in advance.
i have a file "numbers.txt" which have the format.
1,4,7,19,20
5,7,10,15,17
5,11,12,16,18
4,7,12,14,16
1,2,7,10,14
7,9,10,15,18
3,7,8,9,14
3,9,11,13,19
1,2,5,12,15
i want to get all the number and store them into a vector.
i've tried using a stream eg.
string cash_num ;
while (inputfile1>>cash_num){
// *CODE*
}
also i tried declaring cash_num as char as well as int
but nothing works. the commas are posing a problem.
is there anyother clever way to do this?
thanks in advance.