Reputation: 1
error: expected expression before '[' token
msg_ship_detroyed([FLEETSIZE].name);
Please help me to fix this error. Thank you for your time.
Here is part of my code
typedef struct { int length; char name[20]; } Ship;
#define FLEETSIZE 3
Upvotes: 0
Views: 53
Reputation: 144685
The tiny code fragment has a syntax error: [FLEETSIZE]
cannot appear at the start of an expression.
Either you are not programming in C or there is something missing.
Posting a complete program would help diagnose this error in context.
Upvotes: 1