HI, Can someone help me figure out this program: http://web.eng.fiu.edu/watsonh/EEL28...ctOfStruct.cpp and what exactly its doing? I'm having a hard time understanding structures within structures.
Thanks.
Printable View
HI, Can someone help me figure out this program: http://web.eng.fiu.edu/watsonh/EEL28...ctOfStruct.cpp and what exactly its doing? I'm having a hard time understanding structures within structures.
Thanks.
It is calculating the area of the rectangle as input values are top(left, right) and bottom(left, right) corners
I will suggest to you how the program works just go to a debugger in linux GDB
then you can easily understand the flow and what the program exactly is doing
Ok, Im new at this. Let's go back to basics. I understand its now calculating the area of the rectangle, but now can you explain the concept of a structure within a structure before I look at the flow in debug?
The concept of a structure within a structure is: a structure can contain another structure inside it. To use an example that might match what you're looking at: you can create a structure to hold a point on a graph (i.e., two coordinates); then create a rectangle structure that contains two of those points inside it for the corners.