zoukankan      html  css  js  c++  java
  • do while 后面要加分号,你大爷的

    do
    {
        //do something  
    } while (0)
    
    TSfree(url);

    这个TSFree 正好是个宏,然后编译就提示错误:

    error: expected ‘;’ before ‘_TSfree’
     #define TSfree(p) _TSfree(p)
                       ^xyzabc.cc:212:2: note: in expansion of macro ‘TSfree’
      TSfree(url);
      ^

    分析N久才发现,原来 do while 后面要加分号。

    C 语言用了这么多年,还真是没有注意过这个细节。

  • 相关阅读:
    NYOJ 35
    TOJ 3072
    HDU 1075
    POJ 1028
    TOJ 1153
    TOJ 1036
    POJ 1521
    POJ 3253
    NYOJ 467
    HDU 1671
  • 原文地址:https://www.cnblogs.com/elodio/p/4818434.html
Copyright © 2011-2022 走看看