Hi,
I am new in C, trying to create a simple C file, that assign a value for a struct member with the type of string. I can't figure out why it said error : string.c:20: error: expected expression before ‘{’ token, but I don't find any syntax error..
#include <stdio.h>
#include <stdlib.h>
typedef struct _str {
char *s;
int len;
} str;
typedef struct create_session {
str mouse;
} create_session;
void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
int main()
{
create_session *msg_p = 0;
create_session msg;
bzero(&msg, sizeof(create_session));
msg.mouse = {"1234567",7};
msg_p = &msg;
return 1;
}
Can anyone help me with this error?
thank you