C Struct question
From: Michael Ingram (NOme_ingramSPAM_at_earthlink.net)
Date: 01/30/04
- Next message: Attila Feher: "Re: C Struct question"
- Previous message: Ben Measures: "Re: stl vector find."
- Next in thread: Attila Feher: "Re: C Struct question"
- Reply: Attila Feher: "Re: C Struct question"
- Reply: Richard Heathfield: "Re: C Struct question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 05:15:35 GMT
Can anyone explain how these c struct elements are hidden?
Is it file scope of the struct, typedef,...?
Thanks,
Mike
/**************************************************/
/* screen.c
*/
/*
*/
/**************************************************/
struct _screen
{
int transparent;
int ncolors;
o_color_def * colors;
ID focus;
}
void set_screen( screen *new )
{
O_gadget_set_focus( new->focus );
}
/**************************************************/
/* screen.h
*/
/*
*/
/**************************************************/
typedef struct _screen screen;
/**************************************************/
/* state.c
*/
/*
*/
/**************************************************/
#include "screen.h"
static void some_state_function(ID screen_id)
{
screen *screen;
/* this returns an O_gadget pointer, but see below */
screen = O_gadget_new_from_resource(screen_id);
/* THIS LINE WON'T COMPILE */
O_gadget_set_focus( screen->focus); -> dereferncing pointer to incomplete
type
/* BUT THIS WORKS FINE*/
set_screen( screen );
}
- Next message: Attila Feher: "Re: C Struct question"
- Previous message: Ben Measures: "Re: stl vector find."
- Next in thread: Attila Feher: "Re: C Struct question"
- Reply: Attila Feher: "Re: C Struct question"
- Reply: Richard Heathfield: "Re: C Struct question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|