Why would this not work:
#define PORT_ID_MAX_CHAR 6
typedef struct {
int phys;
char name[PORT_ID_MAX_CHAR];
}tPortMap;
struct tPortMap c_portMap[] = { 0, "test" }, { 1,"test" };
GCC barks at me saying myfile.c:8:46: error: expected identifier or ‘(’ before ‘{’ token
struct tPortMap c_portMap[] = { 0, "test" }, { 1,"test" }; and I don't know why... I'm puzzled...
EDIT1
With extra braces I get the error:
struct tPortMap c_portMap[] = {{ 0, "test" }, { 1,"test" }};
myfile.c:8:17: error: array type has incomplete element type
struct tPortMap c_portMap[] = {{ 0, "test" }, { 1,"test" }};
struct tPortMap c_portMap[] = {{ 0, "test" }, { 1,"test" }};solve the problem?6...struct tPortMap, it's justtPortMap