noiseimpera
19-01-2011, 20:52
il più classico degli errori:)
ho una struct del genere:
typedef struct {
char type; /** tipo del messaggio */
unsigned int length; /** lunghezza in byte */
char* buffer; /** buffer messaggio */
} message_t;
ho dichiarato:
message_t* msg_snd=NULL;
e quando accedo:
msg_snd->type=MSG_CONNECT;
dove MSG_CONNECT è una MACRO char,
mi da segmentation fault.
Perchè? Dove sbaglio?
ho una struct del genere:
typedef struct {
char type; /** tipo del messaggio */
unsigned int length; /** lunghezza in byte */
char* buffer; /** buffer messaggio */
} message_t;
ho dichiarato:
message_t* msg_snd=NULL;
e quando accedo:
msg_snd->type=MSG_CONNECT;
dove MSG_CONNECT è una MACRO char,
mi da segmentation fault.
Perchè? Dove sbaglio?