struct list
{
int x;
struct list *next;
}*head;
The statement head.x=100
A)assigns 100 to one element of the structure list
B)creates a node of type list and assigns a value to x
C)creates a head of the list
D)error
Plz anyone provide correct option with explanation..
--
You
ERROR
On Fri, Aug 5, 2011 at 5:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
struct list
{
int x;
struct list *next;
}*head;
The statement head.x=100
A)assigns 100 to one element of the structure list
B)creates a node of type list and assigns a value to x
C)creates a head of the
error
because head is a pointer to the structure, hence head.x gives an error
--
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
Thanks
On Fri, Aug 5, 2011 at 5:25 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote:
ERROR
On Fri, Aug 5, 2011 at 5:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
struct list
{
int x;
struct list *next;
}*head;
The statement head.x=100
A)assigns 100 to one element of
Thanks.
On Fri, Aug 5, 2011 at 5:26 PM, ankit sambyal ankitsamb...@gmail.comwrote:
error
because head is a pointer to the structure, hence head.x gives an error
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
it should be head-x=100 ryt???
On 5 August 2011 17:32, Vijay Khandar vijaykhand...@gmail.com wrote:
Thanks
On Fri, Aug 5, 2011 at 5:25 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote:
ERROR
On Fri, Aug 5, 2011 at 5:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
struct
head-x=100 is not right
if you will first declare
head=new list;
head-x=100;
will be right.
--
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
yes... it would be error ...to be specific it is segmentation faultyou
are trying to access a memory which do not exist
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
On Fri, Aug 5, 2011 at 10:21 PM, pankaj kumar pancsen...@gmail.com wrote:
only by declaring head and then doing head.x=100 is wrongbecause
head is only apointer that can store address of only a list type of
variable...whwn we allocate memmory by malloc or new then you
can do head-x=100..and head.x is wrong ...use either