jjzjj

c++ - 需要帮助解决错误 C2664

我有以下代码给我这个错误main.cpp(41):errorC2664:'std::pairstd::make_pair(_Ty1,_Ty2)':cannotconvertargument1from'Handle'to'unsignedint&'我的示例程序是#include#includetypedefunsignedintu32;typedefu32Handle;structFile{File():ch(0),pageIdx(0){}Handlech:8;u32pageIdx;};intmain(){std::vector>toTrim;toTrim.reserve(64);Fil

c++ - 视觉 C++ :error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char [260]' to 'LPWCH'

当我尝试编译我的项目时,我遇到了一些我无法解决的错误。无论如何这是代码之一:public:voidInit(HMODULEhModule,stringFilename){charszLoc[MAX_PATH];GetModuleFileName(hModule,szLoc,sizeof(szLoc));char*dwLetterAddress=strrchr(szLoc,'\\');*(dwLetterAddress+1)=0;strcat(szLoc,Filename.c_str());__OutStream.open(szLoc,ios::app);}错误是:errorC2664:

C++ --- 错误 C2664 : 'int scanf(const char *,...)' : cannot convert argument 1 from 'int' to 'const char *'

我是C++的新手,我正在尝试构建这个非常简单的代码,但我不明白为什么会出现此错误:Error1errorC2664:'intscanf(constchar*,...)':cannotconvertargument1from'int'to'constchar*'代码如下://lab.cpp:Definestheentrypointfortheconsoleapplication.//#include"stdafx.h"#includeintmain(intargc,char*argv[]){introw=0;printf("Pleaseenterthenumberofrows:");sc