Why don't you post a code that compiles ? On Fri, Sep 30, 2011 at 12:41 AM, Brijesh <brijeshupadhyay...@gmail.com>wrote:
> void main() > > { > void *ptr; > char *a='A'; > char *b="TAN"; > int i=50; > ptr=a; > ptr=(*char)malloc(sizeof(a)); > printf("%c",*ptr); > ptr=i; > ptr=(*int)malloc(sizeof(i)); > printf("%d",++(*ptr)); > ptr=b; > ptr=(*char)malloc(sizeof(b)); > printf("%c",++(*ptr)); > > } > ptr=(*char)malloc(sizeof(a)); > Ans: A51AN > > Please explain the output.. > Doesnt this line ptr=(* char)malloc(sizeof(i)) > > initialize ptr to NULL > > -- > 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/-/QRNgJFXBZawJ. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.