How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?
#include <algorithm> std::reverse(str.begin(), str.end());
This is the simplest way in C++.
Consider following code: char str[] = "Hello\0"; What is the length of str array, and with how much 0s it is ending?
I want to print the full length of a C-string in GDB. By default it's being abbreviated, how do I force GDB to print the whole string?
How to read a string one char at the time, and stop when you reach end of line? I'am using fgetc function to read from file and put chars to array (latter will change array to malloc), but can't figure …