Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

c multiple types question

  • 01-12-2003 5:36pm
    #1
    Registered Users, Registered Users 2 Posts: 1,362 ✭✭✭


    hey everyone,

    I have a project that requires me to define a type that contains members of all built in types eg int, short etc, then I have to use this type and store it in a stack.

    I am new to c and my question is, what is the syntax to create a type made up of lots of different types, for instance to call the type "alltypes" and have it made up of int short float etc?

    thanks a million


Comments

  • Registered Users, Registered Users 2 Posts: 707 ✭✭✭d4r3n


    typedef short int alltypes;


  • Registered Users, Registered Users 2 Posts: 1,362 ✭✭✭tw0nk


    ok cool thanks, exactly what i was looking for


  • Registered Users, Registered Users 2 Posts: 2,281 ✭✭✭DeadBankClerk


    typedef struct _alltypes
    {
    char c;
    short s;
    int i;
    float f,
    double d;
    bool b;
    } alltypes;


Advertisement