objective c - Expected identifier or '(' before '.' token -
i'm new objective-c i'm using book grips it. i'm @ bit it's explaining structs , can't life of me them work.
i have following code:
int main (int argc, char *argv[]) { struct node { int nodeid; int x; int y; bool isactive; }; typedef struct node mynode; mynode.nodeid = 1; }
and i'm getting error written in title. every time search error online found different variations such 'before '>' token' or 'before '}' token' can't find '.' token , it's frustrating , assume it's somethings ridiculously trivial , basic. appreciated.
i believe you're trying modify actual type itself. nodea
type of struct, int
. need nodea mynode
, able perform mynode.nodeid = 1
without error.
Comments
Post a Comment