Answered step by step
Verified Expert Solution
Question
1 Approved Answer
recursive way to print of an string by using pointer.. I want the clear explanation of how does these work // recursive print of a
recursive way to print of an string by using pointer..
I want the clear explanation of how does these work
// recursive print of a string
void print(char* s)
{
if(*s==__char(0)___) return;
cout<<*s;
print(__s+1___);
}
void main(){ char a[6]="hello";
print(a);
}
// recursive reverse print of a string
void rev_print(char* s)
{
if(*s==__char(0)__) return;
___cout<<*s______;
___print(s+1)____;
}
void main()
{ char a[100];
cin>>a;
rev_print(a);
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started