Output string not storing values

In my base case i am assigning string formed to output string , and in the base case i am getting the value stored in output string BUT as soon as it leaves the base case ,
output string becomes null in the recursive case . Please explain how is this possible when we know string is a pointer based data structure and it should retain its value throughout the program .

The problem is exactly similar to the one in which you are generating all of the permutations of given string and all you need to do is to keep track of the original String too and in the base case just check the answer to be printed must be larger than original String, that means in the sample input, you are given cab, so all permutations that need to be printed has to be greater than cab, so it would only be cba…


refer this. it is very easy to understand and on same basis as that of finding all subsequences

As I can see that u have already successfully submitted the solution and have received full points I am closing this doubt