Jassper:
GoForSmoke:
BTW, haven't you learned the simplicity of C strings yet? You've been here for years....
Yes I have been here for years, but I have not been programing for years.
Sorry, that comment, was for Zoomkat who has spent more time championing C++ Strings than it takes to learn C strings more than a couple times over.
It's not something I do on a consistent basis. By trade I am an electrical engineer and only dabble on the software side. For some reason parsing data and handling incoming information has been a huge crutch for me. I'm not sure why but one day I'll get it.
I recently got this book here, http://www.amazon.com/Without-Fear-Beginners-Guide-Edition/dp/0132673266
Hopefully it's a good one.
Thanks for the links and suggestions.
All the things you can do with text is not a small study. If you understand what strings are made of, arrays of char variables and learn to use pointers (address holders) then you can learn function names to look up as you need. Probably the hardest basic part is learning pointers but the payoff goes beyond strings.
As for the functions, keep a table or page with the names and syntax of the handful you mostly will use, far less than half, just for reference. There's no need to memorize it all, the names follow patterns (it helps to be familiar with those) and you can find what you want easily enough from the docs.
strcpy() --- string copy, the string copied can be text in double quotes
strcat() --- string conCATenate, add a string to the end of another
strchr() --- string character, find a character in a string
strcmp() -- string compare
strlen() --- string length
strstr() ---- string string, find a substring within a string
There are versions of these with the letter l in them that take a length argument.
There are versions of these with the letter n in them that do not add a null at the end, which for example lets you paste one string inside another.
less used:
strrev() --- string reverse
stpbrk() --- finds the first character from a list within a string; ex: stpbrk( textArray, " ,.;:" )
strtok() --- string tokenize, has dual behavior that lets you parse text in a loop
strsep() --- also for parsing and a bit simpler than strtok()
Every last one of these is only working with arrays of 8-bit ASCII values with a 0 (NULL) at the end.
The mem functions are also useful, they work on generic bytes and don't stop at NULLs.