Recursively

Hi,

Need some clarification regarding the following example w.r.t recursive .

void f(char *) ; main() { f("123"); } void f(char a[]) { if(a[1]=='\0') return; f(a+1); f(a+1); printf("%c", a[1]); }

The output for this program has been stated as 332. How is it possible ?

It should actually return without printing anything. How can one get '332' as output ?

Thx in advans, Karthik Balaguru

Reply to
karthikbalaguru
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.