草庐IT

display_integers

全部标签

c++ - libpng 错误 : PNG unsigned integer out of range

当尝试从内存中读取PNG时,我遇到了这个奇怪的错误:libpngerror::PNGunsignedintegeroutofrange这个错误是由引起的png_read_info(png_ptr,info_ptr);它使用以下处理程序:staticvoidReadDataFromBuffer(png_structppng_ptr,png_bytepoutBytes,png_size_tbyteCountToRead){PNGDataPtrdataptr=(PNGDataPtr)png_get_io_ptr(png_ptr);png_uint_32i;coutlenpdataptr->l

c++ - 2 个重载具有相似的转换 - 内置运算符 integer[pointer-to-object]

我有以下类(class):classDictionaryRef{public:operatorbool()const;std::stringconst&operator[](std::stringconst&name)const;//...};然后我尝试使用它:DictionaryRefref=...;ref["asdf"];//error输出提示两个重载,但只列出一个:1>...:errorC2666:'DictionaryRef::operator[]':2overloadshavesimilarconversions1>...:couldbe'conststd::string&D

c++ - 预处理器 "invalid integer constant expression"比较 int 和 double

在我的代码中的某处,我有预处理器定义#defineZOOM_FACTOR1我在另一个地方#ifdefZOOM_FACTOR#if(ZOOM_FACTOR==1)#defineFONT_SIZE8#else#defineFONT_SIZE12#endif#else#defineFONT_SIZE8#endif问题是当我将ZOOM_FACTOR值更改为float值时,例如1.5,出现编译错误C1017:无效的整数常量表达式。有谁知道我为什么会收到这个错误,有没有办法在预处理器指令中比较integer和floatingpointnumber? 最佳答案

c++ - XCB 错误 : 148 - Qt application display issues

我正在尝试在另一台计算机上运行我的Qt应用程序(它在我开发它的地方完美运行)。当我通过终端启动此应用程序时,出现此错误-QXcbConnection:XCBerror:148(Unknown),sequence:175,resourceid:0,majorcode:140(Unknown),minorcode:20我的程序确实启动并且一切看起来都正常,但是当我运行它时,我在与显示器交互时看到了奇怪的行为(一些绘画命令没有被执行,这对我的应用程序至关重要)。我已经尝试搜索此错误,但到目前为止我找不到任何解决方案。你有什么建议吗?使用ubuntu16.04,Nvidia1050GTXGPU

c++ - Qt 5.5 和 Qt Installer Framework 2.0.1 : Logo is not displayed despite being present in config. xml

我已经使用预编译的QtInstallerFramework二进制文件2.0.1版为我的应用程序编写了一个安装程序。但是,安装程序窗口不会以任何可能的方式显示我的任何Logo。有问题的Logo名为“installerlogo.png”,这是一个带有alphachannel的64x64图像,位于安装程序目录结构的顶部(与config/和packages/目录所在的目录相同。)为了图标的目的我又做了一个logo,名字叫“installericon.ico”,就是上面那个的16x16版本,只是简单的重命名为“.ico”(是不是做法不对?)我在config.xml文件中尝试了以下内容:insta

c++ - 可变参数模板 : Perfect forwarding of integer parameter to lambda

有类似的问题,但我没有找到适合我的问题的答案。考虑以下代码:#include#include#include#include#includeclassTestClass{public:TestClass(intvalue):mValue(value){}private:intmValue;};templateclassDeferredCreator{public:templateDeferredCreator(Args&&...args):mpCreator([=]()->T*{returnnewT(std::forward(args)...);}),mpObject(){}T*get

c++ - std::make_integer_sequence 究竟是如何实现的?

我正在观看C++11/14元编程演讲,其中描述了常见算法和tmp模式的一些有效替代方案。大部分效率提升来自使用可变参数模板而不是递归遍历,在许多情况下,使用可变参数模板的方法是扩展通过索引技巧或其他std::integer_sequence实例化技巧。由于这种效率来自实例化std::integer_sequence的事实,特别是别名std::make_integer_sequence不是一项昂贵的任务,我想确保当前最先进的C++1y标准库实现效率足以使make_integer_sequence实例化不是一项复杂且耗时/内存的任务。std::make_integer_sequence在C

c++ - "*(pointer + integer)"在 C++ 中有什么作用?

我对这个程序中一行代码的作用感到困惑:int*temp=newint[cap];intnum=0;for(inti=name;iname、number和foo是全局变量(foo是指针),cap是一个参数。具体来说,我不明白这一行:*(temp+count)=*(foo+i);为什么会有指向括号的指针,这有什么作用? 最佳答案 *(temp+count)=*(foo+i);+运算符执行指针运算。将一个整数添加到一个指针值会产生一个新指针,该指针在原始指针之后递增了指定数量的对象。例如,如果p是指向arr[0]的指针,则p+2指向arr

c++ - 为什么标准同时提供了 is_integer 和 is_exact?

std::numeric_limits提供了2个互斥的常量:is_integer:“true对于所有整数算术类型T”is_exact:“true对于所有使用精确表示的算术类型T”是否存在非精确整数类型的可能性?在这里允许做什么?在我知道我是否正在处理精确数字的所有模板中,我使用了is_integer,我现在是否还需要添加对is_exact的检查? 最佳答案 来自is_exactcppreference页面:NotesWhileallfundamentaltypesTforwhichstd::numeric_limits::is_ex

ios - react native AlertIOS 错误 : tried to display alert view but there is no application window

我正在尝试使用AlertIOS显示一条消息,但出现以下错误。警告框的代码嵌套在View和可触摸的突出显示下方。如果AlertIOS组件嵌套在其他组件中,调用它是否会出现问题?varTabOption=React.createClass({deleteConnection:function(){AlertIOS.alert('ConnectionRemoved','Wearenolongerhelpingyouonthisaccount',[{text:'?'}]);});render:function(){return(Disconnect}});varstyles=StyleShee