大约有 8,000 项符合查询结果(耗时:0.0152秒) [XML]
gdb打印c++ std::vector元素内容 - C/C++ - 清泛网 - 专注C/C++及内核技术
gdb打印c++ std::vector元素内容gdb_vector_print使用GDB调试程序或coredump时,直接 p vec 打印的是vector内部成员的信息,不能直观输出元素的内容。通过打印内部元素地址内容的方式,查看vector元素内容,不限gcc版本:(gdb) 使用GDB调试程...
c++11 std::call_once只调用一次函数,类似单例模式 - C/C++ - 清泛网 - 专...
c++11 std::call_once只调用一次函数,类似单例模式std_call_oncestd::call_once 保证函数或者一些代码段在并发或者多线程的情况下,始终只会被执行一次,Demo如下: include <iostream> include <thread>static std::once_flag g_once_flag std::call_once 保证...
浅析Linux段错误:SEGV_MAPERR、SEGV_ACCERR - C/C++ - 清泛网 - 专注C/C++及内核技术
浅析Linux段错误:SEGV_MAPERR、SEGV_ACCERRwhat-is-segv-maperr有两种常见的段错误,SIGSEGV 是段错误终止信号,通常是由无效内存访问导致的错误:访问了具有错误权限的页面。例如,它是只读的,但您的代码试图写入它。这将报告为SEGV_A...
cout保留两位小数输出 - C/C++ - 清泛网 - 专注C/C++及内核技术
cout保留两位小数输出cout_two_decimalC++ std::cout输出2位小数的代码: include <stdio h> include <iostream> include <iomanip> std::setprecision函数需要引入该头文件int main(){ double dval C++ std::cout输出2位小数的代码:
#include <stdio.h>
#include <iostr...
Undefined reference to symbol X509_free - C/C++ - 清泛网 - 专注C/C++及内核技术
Undefined reference to symbol X509_freeundefined-reference-to-symbol-x509-freeUndefined reference to symbol X509_free 编译错误的解决方法:链接库中增加 -lcrypto,而非 -lcrypt参考:https: stackoverflow com questions 33215936 undefined-reference-to-symbol-x509-freeUndefined refer...
【解决】eclipse新建项目报错:overlaps the location of another project:...
【解决】eclipse新建项目报错:overlaps the location of another project: 'xxx'eclipse-error-overlaps-the-location-of-another-projectEclipse新建项目时报错:overlaps the location of another project: & 39;xxx& 39;,确保workspace下没有重复的工程,但之前曾经添加并删...
gcc自带内存泄漏、内存越界检测工具 - asan - C/C++ - 清泛网 - 专注C/C++及内核技术
gcc自带内存泄漏、内存越界检测工具 - asangcc-asanasan内存异常检测工具,功能类似valgrind,不过是gcc自带的原生工具,使用起来非常简单,只需要链接时加上 -lasan 即可。(编译选项也可以加上 -fsanitize=address)测试代码如 asan内...
编译错误 error: ISO C++ forbids declaration of ‘xxx’ with no type [-...
编译错误 error: ISO C++ forbids declaration of ‘xxx’ with no type [-fpermissive]error-iso-c-forbids-declaration-of-with-no-type比较可能的情况1:函数没有写返回类型,加上返回类型后编译成功。 ifndef ttTree_h define ttTree_hclass ttTree {public: ttTree(void); int ...
编译错误 error: ‘typeof’ cannot be used as a function - C/C++ - 清泛网 - 专注C/C++及内核技术
编译错误 error: ‘typeof’ cannot be used as a functionerror-typeof-cannot-be-used-as-a-function编译一些开源的C项目,发现typeof关键字不能被识别,报错:error: ‘typeof’ cannot be used as a function。解决方法:修改C编译选项 -std=gnu99,使用GNU99 ...
eclipse cdt 运行程序时添加依赖库路径 - C/C++ - 清泛网 - 专注C/C++及内核技术
eclipse cdt 运行程序时添加依赖库路径eclipse-cdt-ld-library-path我们知道Linux即使依赖库和可执行文件在同一目录下,如果不使用 LD_LIBRARY_PATH 指定库路径(即当前目录)的话,仍然会报加载不到依赖库的错误。那么Eclipse CDT也是类似,...