Why allow concatenation of string literals?

前端 未结 10 669
借酒劲吻你
借酒劲吻你 2020-11-30 14:47

I was recently bitten by a subtle bug.

char ** int2str = {
   \"zero\", // 0
   \"one\",  // 1
   \"two\"   // 2
   \"three\",// 3
   nullptr };

assert( int         


        
10条回答
  •  孤街浪徒
    2020-11-30 15:45

    I certainly have in both C and C++. Offhand, I don't see much relationship between its utility and how "modern" the language is.

提交回复
热议问题