MFC里面到底可不可以用vector啊?我在StdAfx.h里面加了#include <vector> using namespace std;在类的成员变量里面用了vector类型,还有函数的参数里面也有vector类型,开始一个一个函数写的时候编译好像没问题,最后全写完就出问题了。:\vc98\include\xmemory(34) : error C2538: new : cannot specify initializer for arrays
e:\vc98\include\xmemory(66) : see reference to function template instantiation 'void __cdecl std::_Construct(int (*)[2],const int (&)[2])' being compiled
Generating Code...
E:\FHACA\Ant.cpp(84) : warning C4786: '__ehhandler$?Layout@CAnt@@QAEXV?$vector@V?$vector@HV?$allocator@H@std@@@std@@V?$allocator@V?$vector@HV?$allocator@H@std@@@std@@@2@@std@@V?$vector@HV?$allocator@H@std@@@3@V?$vector@V?$vector@NV?$all
ocator@N@std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@3@@Z' : identifier was truncated to '255' characters in the debug information
不知道什么意思,是不能用vector吗?我对MFC不太熟,谁能帮帮忙
e:\vc98\include\xmemory(66) : see reference to function template instantiation 'void __cdecl std::_Construct(int (*)[2],const int (&)[2])' being compiled
Generating Code...
E:\FHACA\Ant.cpp(84) : warning C4786: '__ehhandler$?Layout@CAnt@@QAEXV?$vector@V?$vector@HV?$allocator@H@std@@@std@@V?$allocator@V?$vector@HV?$allocator@H@std@@@std@@@2@@std@@V?$vector@HV?$allocator@H@std@@@3@V?$vector@V?$vector@NV?$all
ocator@N@std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@3@@Z' : identifier was truncated to '255' characters in the debug information
不知道什么意思,是不能用vector吗?我对MFC不太熟,谁能帮帮忙
就写在那个类中
错误的好像是你构造vector是参数出现的问题。你在检查下吧
试试看:
typedef int Data[2] DATA;
vector<DATA> vecData;
void func(vector<DATA>& vecDat);
====================================================================================
错了. 你看看错误
error C2538: new : cannot specify initializer for arrays
'void __cdecl std::_Construct(int (*)[2],const int (&)[2])' being compiled