Home  >  Q&A  >  body text

c++ - char* p = "123\0123";这是什么意思?

char* p = "123\0123";
cout << strlen(p) << endl;//5

求解释!

怪我咯怪我咯2714 days ago567

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 15:33:52

    http://en.cppreference.com/w/...

    12 is a character, the ASCII code is 10

    reply
    0
  • 黄舟

    黄舟2017-04-17 15:33:52

    This thing is about escape characters
    Newline n 12
    I hope I’m right

    reply
    0
  • Cancelreply