Your recursion is to go to the end of the text string and to then go backwards printing each character.
In other words your function keeps calling itself until it reaches end of string. At that point it returns to where it called itself and the next step is to print the current character.
Then you return to where it called itself again and the next step is to print the current character.
The result is that you traverse the string until the end of string by the recursive calls. Once you reach the end of string you start unwinding the series of recursive calls. At each return you print the current character.
Try the following which will print the current character and then call itself to print the next character instead. When it reaches the end of the string it will unwind the recursive calls.
void test(const char *nap) {
if (*nap != 'D'){
std::cout << *nap;
test(nap+1);
}
};
C, the stack unwinds one and printsBand so on.