Thread: Complex Structures

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    2

    Complex Structures

    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.

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    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

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    2
    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?

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Complex numbers and C structures
    By overlord21 in forum C Programming
    Replies: 20
    Last Post: 09-20-2008, 09:25 AM
  2. Complex numbers and C structures help
    By overlord21 in forum C Programming
    Replies: 1
    Last Post: 09-10-2008, 08:24 AM
  3. Why am I getting 'undelcared identifier' ???
    By Bill83 in forum C++ Programming
    Replies: 2
    Last Post: 02-15-2006, 01:00 PM
  4. arithmetic operator friend functions
    By linucksrox in forum C++ Programming
    Replies: 7
    Last Post: 02-06-2006, 11:39 PM
  5. Problem from texbook
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-26-2002, 04:55 AM