|
-
July 14th, 2005, 11:25 AM
#1
string parsing still...
Hey guys,
I have a config file which it's first few lines are # commented and I want to skip them and start "anazlying" or basically doing string parsing stuff on the rest of the file..
so I've opened the file and i did something like this:
fp is the filepointer, str is the string im getting each line with.
code
...
...
while (getline(fp, str)) {
if ( !str.find_first_of("#") ); {
cout << str << endl;
}
}
i basically want to do my parsing inside the if statement on everything but the commented lines, so i figured id look for them, and when i dont match them then ill be working on the non-commented lines.
but it doesnt work that way when i compile it, i just see the entire file printed out...
any ideas for a simple way of doing this?
thanks.
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
|