C++
机智勇敢正义的萌萌
超级自恋小仙女
展开
-
protoc 生成C++代码
protoc生成c++代码每次都要查一下就很烦恼哦protoc -I=./ --cpp_out=./ ./detect.proto原创 2020-01-10 16:40:20 · 238 阅读 · 0 评论 -
C++中的extern陷阱
extern可以置于变量或者函数前,以标示变量或者函数的定义在别的文件中,提示编译器遇到此变量和函数时在其他模块中寻找其定义。此外extern也可用来进行链接指定。声明函数或全局变量的作用范围的关键字,其声明的函数和变量可以在本模块或者其他模块中使用,记住它是一个声明不是定义!链接指定。当它与"C"一起连用时,如: extern “C” void fun(int a, int b);则告诉编译...转载 2019-10-21 10:49:50 · 357 阅读 · 0 评论 -
摘记-C语言定时器
setitimer函数结构如下:#include <sys/time.h> 2 3 int setitimer(int which, const struct itimerval *new_value, 4 struct itimerval *old_value); 5 6 Timer values are d...原创 2019-10-09 10:29:11 · 302 阅读 · 0 评论 -
摘记-putenv和setenv的区别
putenv和setenv都是用来改变环境变量的。putenv函数#include<stdlib.h> int putenv(const char * string);putenv()用来改变或增加环境变量的内容。参数string的格式为name=value,如果该环境变量原先存在,则变量内容会依参数string改变,否则此参数内容会成为新的环境变量.setenv函数#i...原创 2019-10-09 10:40:17 · 525 阅读 · 0 评论