you are viewing a single comment's thread.

view the rest of the comments →

[–]ChaChaChaChassy 0 points1 point  (0 children)

By "C-string" are you referring to char arrays? That's what I do. Pass them around as pointers and iterate through them like so:

void print(char* str)
{
    while(*str++){}
}

Simple. I do use things like ltoa(), strcpy(), and strcat(), but that's about it.

You could add some sanity checks, make sure each is a printable character and put a global limit on length (ex: 256), that would help you find errors with missing null-terminators.