struct pointer

  • Thread starter emre esirik(hacettepe computer science and enginee
  • Start date
E

emre esirik(hacettepe computer science and enginee

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
 
W

Walter Roberson

emre esirik(hacettepe computer science and engineering) said:
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 );
}
}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top