How to reverse a string using a recursive function, without
swapping or using an extra memory?
Answer Posted / bret
void revDisplay (char a[])
{
if(strlen(a) != 0)
{
revDisplay(a+1);
cout << a[0];
}
}
Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
When can you use a pointer with a function?
What is the purpose of ftell?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
State the difference between realloc and free.
In c programming language, how many parameters can be passed to a function ?
What is the use of getchar() function?
What do you mean by dynamic memory allocation in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
How are portions of a program disabled in demo versions?
What is sorting in c plus plus?
Define recursion in c.
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Write programs for String Reversal & Palindrome check