草庐IT

parameter_table

全部标签

c++ - 'CreateDirectoryW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR' in OpenCV 2. 4.5 和 VS 2010

我正在尝试从openCV2.4.5到VisualStudio2010(基于VC++)的示例代码bagofwords_classification.cpp。但是我发现了错误代码:errorC2664:'CreateDirectoryW':cannotconvertparameter1from'constchar*'to'LPCWSTR'你能帮我解决那个问题吗?谢谢。:)更新v1:staticvoidmakeDir(conststring&dir){#ifdefinedWIN32||defined_WIN32CreateDirectory(dir.c_str(),0);#elsemkdir

c++ - Visual Studio 2010 Arduino cpp 错误 : argument of type "char *" is incompatible with parameter of type "LPCWSTR"

我正在尝试设置一个arduinouno用于与visualstudio2010中的C++程序进行串行端口通信。我正在使用此处找到的代码:http://playground.arduino.cc/Interfacing/CPPWindows不幸的是,.cpp文件在第9行为变量“portName”提供了以下消息:错误:“char*”类型的参数与“LPCWSTR”类型的参数不兼容我不明白这个错误消息,并尝试了一些不同的方法来修复它。任何帮助将不胜感激! 最佳答案 鉴于您问题中的代码链接,问题似乎出在这里:Serial::Serial(cha

c++ - 等同于 "typename",表示从属名称确实是 'template template parameter'

我们将无法找到正确语法的部分代码缩减为最小示例。让我们假设以下定义(不用担心“为什么”;)templateclassElement{};templateclass>classClient{};templatestructTemplatedProvider{templateusingelement_template=Element;};现在,从C++11开始,我们可以使用类模板或类型别名模板来实例化Client模板。以下函数编译得很好:voidfun(){Clientclient;Client::element_template>clientBis;}但在以下情况下,当给Client的模

c++ - 重载 << 运算符错误 C2804 : binary 'operator <<' has too many parameters

这是我的类(class):#ifndefCLOCK_H#defineCLOCK_Husingnamespacestd;classClock{//MemberVariablesprivate:inthours,minutes;voidfixTime();public://Getter&settormethods.voidsetHours(inthrs);intgetHours()const;voidsetMinutes(intmins);intgetMinutes()const;//ConstructorsClock();Clock(int);Clock(int,int);//CopyC

C++ 方法重载 : base and derived parameters

在网上搜索后,我没有设法找到这个问题的答案:我有这个重载方法:foo(Base*base);foo(Derived*derived);在这种情况下,“Derived”是“Base”的子类。当我打电话时:foo(newDerived());我注意到总是调用第一个重载方法,而我想获得相反的结果(调用以“Derived*”对象作为参数的方法)。如何解决?谢谢。编辑:好的,这是我的实际情况:我有一个UIWidget和一个UIScoreLabel类。UIScoreLabel派生自UIWidget。我还有一个GameEvent类(Base)和一个P1ScoreGameEvent类(Derived)

c++ - 错误 : class template partial specialization contains a template parameter that cannot be deduced

我很感激帮助弄清楚我的代码中出现的这个问题是怎么回事,我已将其简化为以下内容:typedefunsignedshortushort;templatestructFoo{};//Specialization--workswhennotaspecializationtemplateclassContainer,templateclass>classMetaFunction>structFoo::Type>>{//typedefContainer::Type>TestType;//OK};intmain(){}在编译(gcc5.4.0)时出现错误:Test.cpp:14:8:error:te

白盒测试(单元测试JUnit使用参数化测试@Parameters)

目录1.背景知识2.例子3.参数化流程4.执行结果5.​​​​​​​练习题1.背景知识    在测试过程中,我们可能会遇到这样的函数,它的参数有许多特殊值,

C++ : using index as template parameter in for loop

给定以下模板和特化enumCountryName{Armenia=0,Georgia,Size=2};templateclassCountryInfo;templateclassCountryInfo{/*CODEHERE*/};templateclassCountryInfo{/*CODEHERE*/};我想遍历枚举并为每个特化创建对象。main(){for(autoi=0;i(i))>();}}我收到以下错误:错误:“i”的值在常量表达式中不可用国家信息(); 最佳答案 您想要的是将运行时变量转换为编译时变量(这是模板参数的要求

objective-c - Xcode:如何在 "unused function"和 "unused parameters"失败下强制构建

您好,我正在尝试将zxing二维码阅读器整合到我的应用程序中。我直接从谷歌代码网站检查了svn,并在我的项目设置中添加了所有标题路径。然而,当我尝试构建项目时,我遇到了很多“未使用的函数”和“未使用的参数”失败,因此无法构建。例如,ZXingWidget项目中有一个名为“-(void)cancel:(id)sender”的方法,我收到未使用参数“sender”的错误。我可以强制构建项目吗?提前致谢 最佳答案 在这个question找到答案“所以我通过删除-Werror和-Wextra摆脱了错误。第一个标签使警告变成错误。我现在不想关

iOS 核心数据 "joining"二 "tables"

我必须在核心数据中使用实体:游戏和玩家游戏-看起来像这样(简化):木板用户名球员用户身份姓名PLAYERS是独一无二的我需要选择GAMES并将PLAYERS.name列添加到此结果。我已经设置了所有核心数据和关系,可以从“表”中选择并将其放入数组和Tableview中。NSFetchRequest*fetchRequest=[[NSFetchRequestalloc]init];NSEntityDescription*entity=[NSEntityDescriptionentityForName:@"GAMES"inManagedObjectContext:context];[fet