struct pointer

Discussion in 'C Programming' started by emre esirik(hacettepe computer science and enginee, Nov 29, 2007.

  1. 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
    emre esirik(hacettepe computer science and enginee, Nov 29, 2007
    #1
    1. Advertising

  2. In article <>,
    emre esirik(hacettepe computer science and engineering) <> wrote:

    >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.serial, &active.price, &active.builder, &active.type,
    &active.model

    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 indistinguishable from a feature."
    -- Rich Kulawiec
    Walter Roberson, Nov 29, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Fogelklou
    Replies:
    36
    Views:
    1,354
    Chris Fogelklou
    Apr 20, 2004
  2. Fernan Bolando

    Pointer to struct or Struct parameters

    Fernan Bolando, Aug 7, 2004, in forum: C Programming
    Replies:
    6
    Views:
    363
    Fernan Bolando
    Aug 8, 2004
  3. beetle
    Replies:
    2
    Views:
    889
    beetle
    Jan 25, 2005
  4. Zero
    Replies:
    16
    Views:
    640
    Barry Schwarz
    Nov 19, 2005
  5. aleksa

    Struct pointer vs. struct array pointer

    aleksa, Feb 20, 2013, in forum: C Programming
    Replies:
    16
    Views:
    451
    Shao Miller
    Feb 20, 2013
Loading...

Share This Page