Haha. No, but it shouldn't be too hard unless you have outlandish requirements for the data structure you are building from the text. For string manipulation it is probably easiest to use Perl--you can probably read an entire file in and split it into arrays in a couple of lines.
annex666 said:Is there a standard c++ function to read tab-seperated files?
Not directly. Here's how you might do this:
1) Use an ifstream file stream object and use its getline() function to get each line of the file into a character buffer.
2) Use the standard C function strtok() on the buffer, passing in "\t" as the delimiter. Each call to strtok() will put a null byte in the next occurrence of the tab character and return a pointer to the beginning the token.
Here's a book on the C++ standard library that I recommend very highly. It's really excellent.
http://www.amazon.com/exec/obidos/t...f=sr_1_1/104-4772311-5671957?v=glance&s=books
http://www.amazon.com/exec/obidos/t...f=sr_1_1/104-4772311-5671957?v=glance&s=books
andy_c said:It's really excellent.
Hmmm... excellent? I found that a book may be "excellent" to one reader, may be not to others, depending on the skill level of the reader, and preferency in learning strategies.
That is for beginners who need the book for learning. For experts, the book may only be needed for reference, and hence completeness is more important than structure.
Just for your info, the C++ standard (or more precisely the
draft version of it) is available on line at
ftp://ftp.research.att.com/dist/c++std/WP/CD2/
There are also plentiful of info on Stroustrups homepage
www.research.att.com/~bs/C++.html
draft version of it) is available on line at
ftp://ftp.research.att.com/dist/c++std/WP/CD2/
There are also plentiful of info on Stroustrups homepage
www.research.att.com/~bs/C++.html
Jay said:That is for beginners who need the book for learning. For experts, the book may only be needed for reference, and hence completeness is more important than structure.
What specific complaints do you have about the book, and what would you recommend as an alternative?
andy_c said:What specific complaints do you have about the book, and what would you recommend as an alternative?
I thought it was a "free" book like what Christer had posted. Didn't see the amazon. So I wouldn't easily be persuaded to buy even if it is highly recommended . Anyway, I prefer that kind of "C++ in One Night!"
- Status
- This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
- Home
- General Interest
- Everything Else
- Simple C++ question