c_cpp 在cpp挑战char问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 在cpp挑战char问题相关的知识,希望对你有一定的参考价值。

#include <iostream>


int main(int argc, char const* argv[]) {
    const char* string = "mm";
    std::cout << "size of regular char is " << sizeof(string[0]) << std::endl;
    const char* a = "马马";
    std::cout << "size of hanzi is " << sizeof(a[0]) << std::endl;
  return 0;
}

以上是关于c_cpp 在cpp挑战char问题的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 在cpp中使用char数组

c_cpp 如何在C中将const char *转换为char *?

C++:从 char 到 char* 的无效转换?

c_cpp 在const char **中使用strtod

c_cpp 在c中检查null char

c_cpp string→char *