草庐IT

input-type-file

全部标签

c++ - (makefile 错误)RTNETLINK 回答 : File exists

这是我的生成文件:delay:tcqdiscadddeveth0rootnetemdelay0mstest4_s_delay:delay./a.out10101231120|teeserver_delay.txt但是,我在执行makefile时遇到以下错误:root@superwii-laptop:/home/superwii/Desktop/Amogh#maketest4_s_delaytcqdiscadddeveth0rootnetemdelay0msRTNETLINKanswers:Fileexistsmake:***[delay]Error2我无法克服这个错误。请帮忙。

c++ - 为什么 "gptr"类型的basic_streambuf是char_type*而不是const char_type*?

设置流缓冲的三个“gptr”的basic_streambuf成员,setg声明为:protected:voidsetg(char_type*gback,char_type*gptr,char_type*egptr);我想知道:为什么每个gptr的类型都是char_type*而不是constchar_type*?在这里使用const_cast为这些gptrs使用constchar指针是否安全? 最佳答案 它不是const,因为streambuf接口(interface)不知道您如何填充缓冲区。例如,underflow和uflow方法可

c++ - type_info 不考虑 cv 限定符 : is this right?

这段代码打印1是正确的行为还是g++4.5的怪癖?#include#includeusingnamespacestd;intmain(){structA{};cout我认为cv限定符的不同类型作为非常不同的类型受到威胁,即使较少的cv限定类型可以隐式转换为更多cv限定的类型。 最佳答案 typeid根据C++标准(摘自ISO/IEC14882:2003的§5.2.8)忽略cv限定符:Thetop-levelcv-qualifiersofthelvalueexpressionorthetype-idthatistheoperandof

c++ - Variadic 模板和 "expected a type"错误

我正在(主要是出于学习目的)自己实现tuple,我刚刚遇到了一个问题。我有以下代码:namespaceRose{templatestructRemoveReference{typedefTType;};templatestructRemoveReference{typedefTType;};templateclassTuple;templateclassTuple{public:Tuple(Firsta,Elems...more):More(more...),Element(a){}Tuple&operator=(constTuple::Type,RemoveReference::Ty

C++ 编译错误 - 命名空间 std 中的 "no type named ' 函数”

我正在为我的C++编程类(class)作业,其中涉及实现HashMap。我的导师给了我们一个头文件,我们需要将其与我们的HashMap类一起使用。提供的头文件包含以下行:typedefstd::functionHashFunction;根据我对C++的(有限的)理解,这会将HashFunction类型定义为std::function。但是,当我编译代码时,出现错误:./HashMap.h:46:15:error:notypenamed'function'innamespace'std'typedefstd::functionHashFunction;~~~~~^./HashMap.h:

c++ - 制作 : No rule to make a header file?

我正在尝试使用名为BigInt的库创建一个项目。我的文件结构是:/Users/wen/Projects/challenge/fibonacci3/fibonacci3.cpp/Users/wen/Projects/challenge/fibonacci3/Makefile/Users/wen/Projects/include/bigint//Users/wen/Projects/include/bigint/MakefileFibonacci3Makefile截至LD_FLAGS=CC_FLAGS=#Includelibrariesinclude/Users/wen/Projects/

c++ - avformat_open_input 函数崩溃

我正在尝试使用avformat_open_input打开一个文件,即使该文件存在,它也会崩溃。av_register_all();AVFormatContext*avFormatContext;if(avformat_open_input(&avFormatContext,argv[1],NULL,NULL) 最佳答案 您必须先将avFormatContext变量设为NULL:av_register_all();AVFormatContext*avFormatContext=NULL;if(avformat_open_input(&

c++ - 使用 vector<int>::size_type 和普通整数有什么区别?

我是c++STL语言的初学者。我想知道这两个代码之间的区别。我问过我的friend,但他说两者是一样的。任何人都可以解释这两个是否相同。并解释为什么这些不同#include#includeusingnamespacestd;intmain(){vectorstudent_marks(20);for(vector::size_typei=0;i>student_marks[i];}return0;}和#include#includeusingnamespacestd;intmain(){vectorstudent_marks(20);for(inti=0;i>student_marks[

c++ - 错误 : cannot declare variable ‘bg’ to be of abstract type ‘cv::BackgroundSubtractorMOG2’ in OpenCV 3

我最近在我的ubuntu14.10系统中安装了OpenCv并且我正在运行一个程序并且正在运行cv::BackgroundSubtractorMOG2我遇到了一个错误。错误是cannotdeclarevariable‘bg’tobeofabstracttype‘cv::BackgroundSubtractorMOG2’为什么我会遇到这个错误我的代码示例intmain(intargc,char*argv[]){Matframe;Matback;Matfront;vector>hand_middle;VideoCapturecap(0);BackgroundSubtractorMOG2bg;

C++ 系统不使用 "source files"

在C++编程语言(第4版)§15.1中,Stroustrup指出:Afileisthetraditionalunitofstorage(inafilesystem)andthetraditionalunitofcompilation.Therearesystemsthatdonotstore,compile,andpresentC++programstotheprogrammerassetsoffiles.遗憾的是,他没有提供更多信息。您知道此类系统的任何示例吗?编辑:我的意思是,如果您知道任何实际免费、商业、开源或其他C++实现,它们不会像我们习惯的那样处理文件。我想知道:为什么会有