Can anybody help me, in c:
How do i read data from a file, eg. numbers
and use them to populate an array?
Since i dont the the amount of data, how do i define the array?
Thanx:confused:
Printable View
Can anybody help me, in c:
How do i read data from a file, eg. numbers
and use them to populate an array?
Since i dont the the amount of data, how do i define the array?
Thanx:confused:
You'd need some kind of dynamically expanding array. In C++ you'd use a vector, but in C you have to work slightly harder and do it yourself.
This is a bit of cheap code I did a while ago that might be useful :)