View Single Post
Join Date: May 2008
Posts: 538
Reputation: Murtan is a jewel in the rough Murtan is a jewel in the rough Murtan is a jewel in the rough Murtan is a jewel in the rough 
Solved Threads: 86
Murtan Murtan is offline Offline
Posting Pro

Re: read line of text from file into array

 
0
  #8
Jan 15th, 2009
If the compiler is complaining, the code is obviously still not right.

Maybe you should define the missing symbols?

try int array_words[10]; right next to where you declare get_content. (They're both used in the same place.)

The declaration for char str[BUFSIZ] needs to come before the for loop that copies into it:
  1. for(int i =0; line[i];++i)
  2. str[i]=line[i];

That code sure looks like a strcpy() to me, maybe you should look into it.

PS- When posting c++ code, please use c++ code tags
[code=c++]
// Your code here
[/code]
Reply With Quote