View Single Post
Join Date: Oct 2008
Posts: 44
Reputation: zalezog is an unknown quantity at this point 
Solved Threads: 11
zalezog zalezog is offline Offline
Light Poster

Re: read line of text from file into array

 
0
  #9
Jan 16th, 2009
That code sure looks like a strcpy() to me, maybe you should look into it.
  1. string line;
  2. char str[BUFSIZ];
1. Murtan is absolutely right when he says that declaration of
  1. str[BUFSIZ];
  2. int array_words[10];
should be before the loop where the content of 'str' is copied into 'line',same goes with array_words[10]
2.As the declarations of 'str' and 'line' are not ,C-styled strings,i had to use a for loop.Perhaps, AdRock tried using
  1. strtok(..,..)
with string line and got stuck, that's how the whole thread began.
Last edited by zalezog; Jan 16th, 2009 at 5:47 am.
Reply With Quote