A line has to be drawn somewhere. A forum is not the place to learn basic C++ language concepts. That is the domain for books, and if available on-line sites dedicated to teaching the language.Quote:
Originally Posted by JasonBB
Again, and I won't repeat it -- we need to see what you wrote, not what someone else wrote. We have no idea if you may have changed something, missed a line, added a line, etc. Too many times, we're guessing as to what someone wrote, and then 20 posts later, lo and behold it isn't what they claim they wrote. To circumvent all of these problems, take the time to post the code you wrote so that this doesn't occur.Quote:
Unless you though that I forgot headers and the main method, I don't see why you needed my version of the code.
And what is insulting about it? It is one of the best FAQ's out there for C++ on the internet.Quote:
Slightly insulting, but okay.
Note that this is the C++ FAQ that is maintained by comp.lang.c++. It is *the* newsgroup forum for asking C++ questions. They have a protocol, and a darn good one, when someone asks a question concerning code that doesn't work. It is also the FAQ that others here point others to when asking more specific C++ questions.
This is one fix you must do:
A std::string requires a char* for it to be initialized, and a pointer to the first element of a vector<T> is a T*.Code:mystring = &buffer[0];
Regards,
Paul McKenzie
