Why are empty expressions legal in C/C++?

后端 未结 11 1841
囚心锁ツ
囚心锁ツ 2020-11-29 11:21
int main()
{
  int var = 0;; // Typo which compiles just fine
}
11条回答
  •  清歌不尽
    2020-11-29 11:44

    Obviously, it is so that we can say things like

    for (;;) {
      // stuff
    }
    

    Who could live without that?

提交回复
热议问题