for the first o/p qs
as p1 is moving towards the NULL('\0') character so is p2...to avoid dis
save the base address and den let p2 move forward with p1
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
char *save;
save = (char *)malloc(20);
save = p2;
if(p2==NULL)
cout<<"\n NOT ENOUGH SPACE";
else
{
while(*p2++=*p1++);
printf("%s\n",save);
}
for the second qs o/p = 25
cz post incr means first use den incr thererfore 5*5
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/lOll02QN_pwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.