how to know the number of data

i use matlab to get the data.....after that i write the data in text file.......afterthat i want read the data in c++.......how can i know how many data i have....?
Do you mean a total sum? Or how many items?

Both are quite easily possible. Just create a loop and keep it going until you've grabbed all the data from your file. If you want a total, add the newly grabbed value to a total variable in each iteration. If you want a count of how many values, just increment a counter at each iteration.
i want to know how many item in my file......

example :-
if in my data have :-
0
1

i will know i have 2 data only.....
how to get that when i using c++ to read data in my file?
thanks you.....i know what u means......:)
Topic archived. No new replies allowed.