void ReversePrint(char* ch)
{
if(ch == NULL)
{
cout << "NULL"<<endl;
return;
}
int size = strlen(ch);
for(int i = size-1; i >=0; i--)
cout << ch[i];
}
void ReversePrint(char * ch) //recursion
{
if(*ch == '\0')
return;
ReversePrint(ch+1);
printf("%c",*ch);
}
void ReversePrintStringUsingStack(char* ch)//stack
{
stack<char> s;
for(int i = 0; i < strlen(ch); i++)
s.push(ch[i]);
for(int i = 0; i < strlen(ch); i++)
{
printf("%c ",s.top());//or cout << s.top(); reverse print
s.pop();
}
}