String to function: any best practices?

C++ String class, when you change a String (at least when the size changes) makes a copy of itself including overhead bytes and deletes the original which leaves a hole in the heap. One of the 'conveniences' being that you don't 'see' it happen.
Maybe the next allocation will fit in the hole. Might even fill it. If it doesn't then it goes on the end and bumps the heap size up. At the same time, the stack grows and shrinks from the top of ram down. If heap and stack collide then what happens isn't something you can find through simple examination of your source logic.

Here are some signs and observations of the road ahead for beginners:

All the C string commands boil down to simple enough ideas that you can roll on your own. You need to be aware of your own buffer lengths and do bounds checks even if you use the built-ins. I really think from having rolled my own that making your own teaches enough to lose the mystery and fear of of commands like strcmp (string compare), to know that strncpy differs from strcpy by how each deals with number of characters copied and terminating zero. Strncpy does not place a terminating zero at the end of the copied section which is essential when changing characters in the middle of a string -- it is equal to the BASIC MIDSTR$() command.

Why prefer strcmp to stringCompareTo? Because I'm not a masochist. Because getting used to the abbreviated code takes a short while and it takes less thought-space too. That's why we shorten names and words, especially technical words, or have "big words" to replace whole sentences. It's the difference between in many cases English and German, two syllables vs many. OTOH many technical names in German tell just what a thing is or does in detail, like long variable names. But say them ten times fast, you can't. Long words are harder to think.

Setting up a flag and while loop to compare two arrays is drop dead simple once you've done it a time or two yet for those who have not there's some kind of dread. It takes more mental work to constantly come up with meaningful comments!

A pointer is a pointer, it's not the data, it only points to data. You add 1 to a byte pointer and it points to the next byte. You can walk through an array by setting a pointer to the start and incrementing the pointer as you go, it's like working with an index where you don't have to use the array name and brackets, it saves typing. There's even pointers to pointers, pointers to functions and pointer tables. Take a week or more to get the basics down and do the homework because pointers are one of the most versatile and powerful things in C.

The best part of high level for me means not having to know what CPU registers are being used. I use libraries when I need them but I know that behind every convenient function there are a couple to many lines of code and maybe (probably) some stack variables in addition to passed args.

If you use sscanf or atoi or any functions that can return an error (feed atoi "123foo") then check for error returned. It's easier to code for everything going right but that's wishful non-thinking unless you made sure in previous code. If you're that good then all of the above is old hat anyway.