|
-
Apr 13th, 2002, 05:32 AM
#1
Thread Starter
Lively Member
Read from file into array (C)
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
-
Apr 13th, 2002, 06:54 AM
#2
Monday Morning Lunatic
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
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|