[plug] C Programmers Only

David Campbell campbell at torque.net
Mon Mar 15 15:11:58 WST 1999


From:           	HILL  Walter <walter.hill at customs.gov.au>
To:             	"P.L.U.G." <plug at linux.org.au>
Subject:        	[plug] C Programmers Only
Date sent:      	Mon, 15 Mar 1999 17:41:47 +1100
Send reply to:  	plug at linux.org.au

> Help,
> 
> If I have a struct such as:
> 
> struct call
> 	{
> 	int seq;
> 	struct date callDate;
> 	struct time start;
> 	struct time duration;
> 	char phoneNumber[PHONE_SIZE]
> 	};
> 
> Then I malloc() one.
> 
> How do I pass by reference one of the component of the struct?
> 
> ptr = (struct list_node *) malloc(sizeof(struct list_node))
> 
> sscanf(buf, "%d", ????)

sscanf(buf, "%d", &ptr->seq);

David Campbell
=======================================================
campbell at torque.net
Check http://www.torque.net/parport for all Linux parallel port solutions.
(also check http://www.torque.net/parport/archive/current/)
Current project list:
a) Catch up on the ZIP Plus backlog (drive back from waranty)
b) Maintain Linux ZIP drivers (need to update docs)
c) sleep
d) real life


More information about the plug mailing list