|
-
June 2nd, 1999, 02:55 AM
#3
Re: Reading Text Files
use the strcmp function to compare char-pointers.
Your program doesn't work if the '//' are not at the beginning of a line. You can read a line and then use strstr to find the substring '//'.
Another tip : see to the getline function. It's a function defined in STL. You don't have to worry anymore about the linelength. STL will do it for you. You can also use the string-implementation of STL.Of course this means you have to dig in STL and that's not always easy. A very good startpoint for this is reading the chapters of Thinking In C++, which you can find here at Codeguru.
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
|