hmm ya am sorry abt that..what abt the first part i mentioned...how is it (nodeptr*)malloc according to you (which is creating a pointer to a pointer type nodeptr )rather than just nodeptr which is a pointer to structure? how to get size of structure as such in this case?
On Thu, Aug 11, 2011 at 7:04 AM, siddharth srivastava <[email protected]>wrote: > > > (sizeof(struct)); ?? >> > > That doesn't makes sense. Size of struct is what ?? you need the size of > your structure with the variables you have declared in it. > > >> >> cos malloc returns pointer to memory block and nodeptr itself is a pointer >> and you have used nodeptr* further? >> >> >> >> On Tue, Aug 9, 2011 at 6:32 PM, siddharth srivastava <[email protected] >> > wrote: >> >>> @sidharth: thanks a lot for correcting me :) >>>> @aditya : no. there was some mistake; >>>> >>>> in the code i pasted above it's giving segmentation fault. Is it cause >>>> i'm initializing h without using malloc?? >>>> Please throw light on this problem >>>> >>> >>> Pointer points to a location in memory. You can't use h without making h >>> to reference to some area in memory. >>> >>> >>> >>>> And in the following code >>>> char *s; >>>> scanf("%s", s); >>>> why isn't it possible to store a string in s?? >>>> >>>> Please explain both concepts. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> 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. >>>> >>> >>> >>> >>> -- >>> Regards >>> Siddharth Srivastava >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> 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. >>> >> >> >> >> -- >> "People often say that motivation doesn't last. Well, neither does >> bathing - that's why we recommend it daily." >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> 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. >> > > > > -- > Regards > Siddharth Srivastava > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > 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. > -- "People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily." -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. 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.
