草庐IT

redefined-outer-name

全部标签

C++ : Read a file name from the command line and utilize it in my file

如何从命令行读取文件名并在我的C++代码文件中使用它?例如:./cppfileinputFilenameoutputFilename非常感谢任何帮助! 最佳答案 intmain(intargc,char**argv){stringinFile="";stringoutFile="";if(argc==3){inFile=argv[1];outFile=argv[2];}else{cout 关于C++:Readafilenamefromthecommandlineandutilizeiti

c++ - Bison and doesn't name 类型错误

我有以下文件:CP.h#ifndefCP_H_#defineCP_H_classCP{public:enumCardinalite{VIDE='\0',PTINT='?',AST='*',PLUS='+'};CP(CardinalitemyCard);virtual~CP();private:Cardinalitecard;};#endif/*CP_H_*/和dtd.y%{usingnamespacestd;#include#include#include#include"AnalyseurDTD/DtdDocument.h"#include"AnalyseurDTD/CP.h"voi

C++ 函数名称分解 : What does this name suffix mean?

当我反汇编Chromium二进制文件时,我注意到有一些函数以这种模式命名:_ZN6webrtc15DecoderDatabase11DecoderInfoD2Ev.part.1如果我把这个字符串给c++filt,输出是webrtc::DecoderDatabase::DecoderInfo::~DecoderInfo()[克隆.part.1]那么这个.part.1后缀的真正含义是什么?如果它表明同一个函数有多个拷贝,他们为什么需要那个?是因为位置独立的要求吗?我使用g++作为编译器。 最佳答案 它表示析构函数是partialinli

c++ - getline(cin.name) 被跳过

我从C++中的一个函数调用一个函数,该函数具有getline(cin,name)行,其中name是一个字符串。第一次通过循环时,程序不等待输入。它将通过循环的所有其他传递。有什么想法吗?voidgetName(string&name){intnameLen;do{cout 最佳答案 确保自上次从cin读取内容后没有遗漏,例如:在你的程序的前面一点:intnumber;cin>>number;您提供的输入:5程序后面:getline(cin,name);和getline似乎不会被调用,而是它收集了您上次输入时的换行符,因为当您使用ci

c++ - '简历' : a namespace with this name does not exist while building (VS 2015, OpenCV 3.2)

在VS2015中构建一个简单的OpenCV应用程序时出现错误'cv':anamespacewiththisnamedoesnotexistwhilebuilding虽然我相信我已经完成了为VS配置OpenCV所需的所有步骤(使用本文作为引用http://opencv-srf.blogspot.com/2013/05/installing-configuring-opencv-with-vs.html)类(class)的开始很简单#include"opencv2/imgcodecs.hpp"#include"opencv2/highgui.hpp"#include"opencv2/sti

c++ - (C++14) lambda 数组 : error: 'name' declared as array of 'auto'

我很难解决这个错误。我承认,我是C++的新手,我的困难来自于不理解错误消息。代码如下:autoselectionFuncs[8]={[&](constVector3&min,constVector3&max){returnmax.x_==seamValues.x_||max.y_==seamValues.y_||max.z_==seamValues.z_;},[&](constVector3&min,constVector3&max){returnmin.x_==seamValues.x_;},[&](constVector3&min,constVector3&max){returnm

c++ - c++11 中的 typeid(T).name() 替代方案?

在c++11中是否有一种标准的方法来使用一些模板黑魔法或动态地使用一些标准库函数来获取类的名称? 最佳答案 不,但你可以做一个:templatestructmeta{staticconststd::string&get_name(){returnT::class_name;}};然后将静态成员class_name添加到类中:classMyClass{public:staticconststd::stringclass_name("MyClass");};或专门化元:templatestructmeta{staticconststd:

c++ - "Expected class-name"...析构函数实现中的问题

我正在尝试实现堆栈和队列。我还获得了用于测试堆栈和队列的代码(以查看它们各自的功能是否正常工作)。我已经实现了stack和quete的功能,但是在尝试编译它们时出现错误:在析构函数“Stack::~Stack()”中'('标记前的预期类名在他们两个。以下是通用的Stack类:templateclassStack{Listlist;public:Stack();Stack(constStack&otherStack);~Stack();}列表类:templateclassList{ListItem*head;public:List();List(constList&otherList);

从[parendid,name]目录dict到完整的路径dict

我有一个目录的命令[parentid,name]像这样:D={0:[-1,'C:'],1:[0,'BLAH'],2:[0,'TEMP'],3:[1,'BOOO'],4:[1,'AZAZ'],5:[2,'ABCD']}我想从这途径到完整的道路:FULLPATHS={}forkey,pathinD.iteritems():newpath=path[1]ifpath[0]!=-1:newpath=FULLPATHS[path[0]]+'\\'+newpathFULLPATHS[key]=newpath有用:{0:'C:',1:'C:\\BLAH',2:'C:\\TEMP',3:'C:\\BLAH\\

vue3+vite+typescript出现does not provide an export named ‘xxx‘ 解决方法

vue3+vite+typescript出现doesnotprovideanexportnamed‘xxx’解决方法。在使用TinyMCE富文本组件时,出现以下错误:Therequestedmodule‘/src/main/ts/components/EditorPropTypes.ts?t=1674647216370’doesnotprovideanexportnamed‘IPropTypes’。对应EditorPropTypes.ts中的代码:exportinterfaceIPropTypes{apiKey:string;cloudChannel:string;id:string;init