in C++, cannot assign a pointer to an array.
c++中char*与char[]不是一种类型,但是在C里面可以,所以尽量使用C++中的类,如string, vector等等。若非一定要解决这个问题,可以使用char *ptr = new char[2];

相关文章:

  • 2022-02-02
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-04-14
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案