struct pointer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • emre esirik(hacettepe computer science and enginee

    #1

    struct pointer

    I couldnt find how to point of struct

    typedef struct _guitar {
    int serial;
    int price;
    char type[18];
    char builder[18];
    char model[18];
    }guitar ;


    void func();
    guitar active;

    I want to send active.serial, active.price, active.builder,
    active.type, active.model, how can I do????



    void funct2( ???????? (this structer's pointer) how can I do???)
    how can I use active data of struct guitar



    help me please
  • Walter Roberson

    #2
    Re: struct pointer

    In article <c2251762-c2e3-4ca5-a217-03c7f3180a25@e1 0g2000prf.googl egroups.com>,
    emre esirik(hacettep e computer science and engineering) <emreesirik@gma il.comwrote:
    >I couldnt find how to point of struct
    >typedef struct _guitar {
    int serial;
    int price;
    char type[18];
    char builder[18];
    char model[18];
    >}guitar ;
    >void func();
    guitar active;
    I want to send active.serial, active.price, active.builder,
    >active.type, active.model, how can I do????
    Individually,

    &active.seri al, &active.pric e, &active.builder , &active.type ,
    &active.mode l

    The structure as a whole:

    &active
    >void funct2( ???????? (this structer's pointer) how can I do???)
    how can I use active data of struct guitar
    void funct2( guitar *gptr ) {
    if (gptr->price 1000000) {
    printf( "Guitar serial #%d is one expensive guitar!\n",
    gptr->serial );
    }
    }
    --
    "Any sufficiently advanced bug is indistinguishab le from a feature."
    -- Rich Kulawiec

    Comment

    Working...