Why allow concatenation of string literals?

前端 未结 10 655
借酒劲吻你
借酒劲吻你 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:36

    So that you can split long string literals across lines.

    And yes, I've seen it in production code.

提交回复
热议问题