I want to get a string from input but I don't want to waste any space by declaring a char array with elements that may not be used. A pointer to char wouldn't be much different I assume. So what are my options here?
I want to get a string from input but I don't want to waste any space by declaring a char array with elements that may not be used. A pointer to char wouldn't be much different I assume. So what are my options here?
Your options are:
- Declare a char array with enough space.
- Write an entirely new string library from scratch that automatically resizes itself.
Heh, that's what I was afraid of.