expected '=', ',', ';', 'asm' or '__attribute__' before '.' token

前端 未结 3 1087
借酒劲吻你
借酒劲吻你 2021-02-01 19:56

\"enterCould not able to solve this.. I am implementing a queue. After writing the complete code I

3条回答
  •  温柔的废话
    2021-02-01 20:51

    As @Naveen said you can't assign to a member of a struct that is in global scope. Depending on the version of C though you could do this:

    struct Queue q = {0,0};
    

    or

    struct Queue q = {.front = 0, .rear = 0 };
    

提交回复
热议问题