K
karthikbalaguru
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
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