Thread: Structures...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    9

    Unhappy Structures...

    Can anyone explain structures for me? I cant quite understand the tutorial to satisfy my needs....

  2. #2
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343
    A structure is exactly like a class, except that its members are public by default.

  3. #3
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    A structure is a collection of variables placed in one object. Eg,
    Code:
    struct MyStruct // declaration of the structure
    {
        // declare the different variables that are a part of this collection...
    
        int var; 
        float thing;
        char stuff[100];
    };
    
    int main()
    {
        MyStruct instance; // create an instance of the structure just like you would a normal variable
        
        // access the different variables within your newly declared object
        instance.var = 69; // heh, 69...
        
        return 0;
    }

  4. #4
    Registered User
    Join Date
    Dec 2002
    Posts
    103

    We had discussed in our earlier post

    Hi

    Search this link.... you will be filled with information

    cboard.cprogramming.com/showthread.php?threadid=32253
    Have a wonderful day.... and keep smiling... you look terrific that way
    signing off...
    shiv... as i know him

  5. #5
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    If you want more info after that, then go here.

  6. #6
    Lol... its the all mighty essay! But its the best I have read ever!
    Totally recommended. By the way do you mind if I used that as a tutorial on my site?


    -Devouring One-
    Dev C++
    Win XP/2k/98

    I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!

    He's lean he's keen... He's the spank machine!

  7. #7
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    I'd prefer if you didn't (sorry). If I get a chance, I'd like to add to it and I might make a site and upload it. If you want, I can give you a link when and if that happens, and you can link to it.

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