Thread: Structures??

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    63

    Structures??

    Hey guys,
    where can I find decent notes on the net on Structures..I am sure you guys must know libraries on the net that do a good job of explaining it..Please let me know.Thanks!
    A

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Code:
    struct mystruct
    {
        /* stuff goes here */
    };
    A structure is a group of variables which are given a new variable type.

    struct mystruct x;

    This is creating an instance of a variable, named 'x', who's type is 'struct mystruct'.

    You access the members of the structure by using the . operator.

    For example:

    'struct mystruct' contains an integer called 'myint'.
    To access it, we use:

    x.myint

    So, to set the variable:

    x.myint = 10;

    This is the same thing as:

    int someint;

    someint = 10;

    Structures are very easy to understand and use.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    22
    That was a real good explanation Quzah!!!

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    63
    Thanks Quzah but I was hoping to find tutorials on the net..and thought that you guys might know of some..

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by aspand
    Thanks Quzah but I was hoping to find tutorials on the net..and thought that you guys might know of some..
    Google is your friend.

    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Registered User
    Join Date
    Apr 2002
    Posts
    63
    that really helps!!!!

  7. #7
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > that really helps
    Agreed.
    The world is waiting. I must leave you now.

  8. #8
    Registered User
    Join Date
    Apr 2002
    Posts
    63
    I was being sarcastic!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-11-2008, 07:39 AM
  2. Structures, passing array of structures to function
    By saahmed in forum C Programming
    Replies: 10
    Last Post: 04-05-2006, 11:06 PM
  3. Input output with structures
    By barim in forum C Programming
    Replies: 10
    Last Post: 04-27-2004, 08:00 PM
  4. pointers to arrays of structures
    By terryrmcgowan in forum C Programming
    Replies: 1
    Last Post: 06-25-2003, 09:04 AM
  5. Methods for Sorting Structures by Element...
    By Sebastiani in forum C Programming
    Replies: 9
    Last Post: 09-14-2001, 12:59 PM