How to use fgets if you dont know the number of characters to be read.

Posted by vette982 on Stack Overflow See other posts from Stack Overflow or by vette982
Published on 2010-05-21T04:21:08Z Indexed on 2010/05/21 4:30 UTC
Read the original article Hit count: 241

Filed under:
|
|
|

I need to read a file and send the text from it to a string so I can parse it. However, the program won't know exactly how long the file is so what would I do if I wanted to use fgets, or is there a better alternative?

Note:

char * fgets ( char * str, int num, FILE * stream );

© Stack Overflow or respective owner

Related posts about c

    Related posts about c++