Structures are fairly easy to grasp, but they do have one other small trick to them -- when you're using Pointers-to-structures. Say we create a pointer-to-structure named enchilada. After creating memory and assigning it to enchilada, we're ready to play around with it. Here's where the weird part comes in -- when you're accessing variables from a pointer-to-structure, you use "->" instead of ".". To access a variable named tasty inside the structure pointed to by enchilada, you say: enchilada->tasty
The -> tells C++ that you want to access the element (*enchilada).tasty If you're a little unsure of that code, heres what it's saying in a breakdown:
|