I get a segment fault while it comes to the memset,i've looked anywhere can't know why?Can anyone tell me what's wrong?
typedef struct Ircsend1_struct{
char type;
char name[32];
}ircsend1_struct;
ircsend1_struct *ircpack;
char *pBuffer;
ircpack = (ircsend1_struct *)pBuffer;
memset(ircpack,0x00,sizeof(ircsend1_struct));
Because your pointer is not initialized, maybe you mean
ircsend1_struct irpack;
char *pBuffer = &irpack;
memset(pBuffer, 0, sizeof(ircsend1_struct));