0
我使用Visual Studio 2013转换,我得到以下错误:错误C2664:无法从 'LPTSTR []' 到 'LPCTSTR *'
error C2664: 'DWORD Options(int,LPCTSTR *,LPCTSTR,...)' : cannot convert argument 2 from 'LPTSTR []' to 'LPCTSTR *' 54 1 ConsoleApplication3
这是代码:
DWORD Options(int argc, LPCTSTR argv[], LPCTSTR OptStr, ...){
// Code
}
int _tmain(int argc, LPTSTR argv[]){
iFirstFile = Options(argc, argv, _T("s"), &dashS, NULL);
// Code
}
有谁知道如何修理它?
并解释为什么会发生此错误?
使用'选项(ARGC,const_cast会(ARGV),_T( “S”),dashS,NULL);' –
RbMm
@RbMm:为什么你会永远使用'const_cast'来**添加一个'const'限定符? – IInspectable
RbMm它没有工作。它错误:错误LNK2019:解析外部符号__imp__ReportError在函数引用_main \t 和错误LNK1120:1周无法解析的外部 – zzZOsiroZzz