Quote:
Originally Posted by kingo
k thanx
My pleasure.
Also with the return statement heres the code.
Code:
#include <iostream.h>
#include <string.h>
int RevStr(char *inArr, char *outArr,int start,int cLen)
{
return(((*(outArr+start) = inArr[cLen-1]) && (cLen > 0))?RevStr(inArr, outArr, start+1, cLen-1):0);
}
int main()
{
char * ptr = "Go4Expert";
char *outptr = 0;
outptr = new char[strlen(ptr) + 1];
RevStr(ptr, outptr, 0, strlen(ptr));
cout<<outptr;
return 0;
}