Could someone explain to me what does this sign mean :
"->", i've heard that it is a po inter to structure sign...
When should I use this, and what does it achieve for me?
Could someone explain to me what does this sign mean :
"->", i've heard that it is a po inter to structure sign...
When should I use this, and what does it achieve for me?
Only by the cross are you saved...
If you have a pointer to structure, you can use that arrow operator to point to that structure member.
Say you have a structure named blah and a pointer to stucture named ptrStruct which has already been assigned, you can do this to access that structures members.Code:struct blah { int blah1; int blah2; int blah3; } ptrStruct->blah1 = 50; printf("%d", ptrStruct->blah3);
Last edited by stumon; 06-06-2003 at 11:05 PM.
The keyboard is the standard device used to cause computer errors!
If you have a structure called employee, you reference an element in the structure like this:
employee.salary
This references the structure directly
But if the employee is a pointer to the structure, you use:
employee->salary
This references the structure thru a pointer to the structure
Ya beat me, stumon!
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
lol, by like 23 minutes. ;D
The keyboard is the standard device used to cause computer errors!