C++代码编译报错信息:

conversion from 'LinkedList<myInt>*' to non-scalar type 'LinkedList<myInt>' requested


有可能是因为C++ new对象的写法跟java不一样:

(1)

LinkedList<int> *test = new LinkedList<int>();

C++中只是声明对象而未new时,写法跟java一样:

(2)

LinkedList<int> test

相关文章:

猜你喜欢
  • 2022-01-29
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案