>size_t size = strlen(reverse);
For starters, you need to include <cstring> to use the C-style string functions.>char * getwords = new char();
This is the cause of your undefined behavior. You allocated one character. Only one. That means you can only store one character, ever. But look here:
thanks, i had wondered how to allocate more instead of using a constant char foo[100]; i thought maybe that was the solution, if not i will ask around :)
>cin.getline(getwords,100);
You're telling getline that it can store up to 100 characters in getwords. This is called buffer overflow, and it's undefined. That's a very bad thing.
very much so :)
>cin.sync();//clean up buffer for next example
sync isn't required to do what you think it does. An extremely knowledgeable person explained why here. ;)
will read, i remember someone posting about using cin.flush to remove any characters from the buffer in case a user entered in more than was allocated but i tried that and got errors :(
I'm not a huge fan of stdafx.h either, but I can let that slide.
yeah i didnt want to include it, i checked the box to remove pre-compiled headers but i guess i have no say in that when using the express version of VC++.
oh and by the way, when i was researching this in google a few links to daniweb popped up, and of course you were the one responding and …