conversion from 'LinkedList*' to non-scalar type 'LinkedList' requested

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
posted @ 2016-08-18 21:24  Victor_Lv  阅读(1123)  评论(0编辑  收藏  举报