Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > struct pointer

Reply
Thread Tools

struct pointer

 
 
emre esirik(hacettepe computer science and engineering)
Guest
Posts: n/a
 
      11-29-2007
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
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      11-29-2007
In article <(E-Mail Removed)>,
emre esirik(hacettepe computer science and engineering) <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struct pointer vs. struct array pointer aleksa C Programming 16 02-20-2013 08:20 PM
Can *common* struct-members of 2 different struct-types, that are thesame for the first common members, be accessed via pointer cast to either struct-type? John Reye C Programming 28 05-08-2012 12:24 AM
(: Pointer to struct withing pointer to struct :) Zero C Programming 16 11-19-2005 01:27 AM
passing pointer->struct->pointer->struct to function. .. ?? beetle C Programming 2 01-25-2005 06:08 PM
struct my_struct *p = (struct my_struct *)malloc(sizeof(struct my_struct)); Chris Fogelklou C Programming 36 04-20-2004 08:27 AM



Advertisments