no, no, no .... That's not the way to go!
You put some code with some syntax error and even some misconception in it.
That reveal that you are not understanding what your code has to do.
The compiler just gives some errors, but those errors are random as your code is. Attempting to fix those errors doesn't lead anywhere: you're never granted your code will do what you expect.
printf("Enter a string : ");
s is a pointer pointing to nowhere: where do ypu thoing your scanf can write to ?!? s[l]=0; tries to write to nowhere since s isnowhere a is a pointer to int, but you do a=(char*)malloc(l): what did you want to do? allocating char-s or int-s ?!
This is a mess of tokens with no syntax meaning! Raed about the for syntax, and understand the proper use of '()', ',', and ';'.
x=l-1 Wow... you're looking for problems: never use names like "O" and "l": I have to change font before find it's "l-1" and not "l-l" ... Do you get what I mean? If not, than that demonstrate the problem
Then: I see a malloc, but i don't see a free: not a good way to program...
I don't continue, but what can you do if you don't have clear in your mind what you're gonna do?
Thanks for vital information and suggestion.
I want to generate Combination of given String.Like this CString test="ABC", then generate like this
If you have any type solution or suggestion then please help me.
Ok, that's the problem. Now try to come to an algorithmic solution.
That doesn't need to be C or C++, just pseudocode.
Only when you find your algorithm looks meaningful, try to code it!
Than: the problem is not well formed. Do you want only two char-s combination? Does the input string needs to be 3 char-s wide or can it be whatever?
Be sure about that: you risk to produce a code that works on a very specific case, while looking for something more generic.