![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
kjlr
脚踏实地,不忘过去,不畏将来,在最好的开发平台上做出最好的产品!
展开
-
C/C++中的联合体union及CPU大小端判定
在C/C++程序的编写中,当多个基本数据类型或复合数据结构要占用同一片内存时,我们要使用联合体;当多种类型,多个对象,多个事物只取其一时(我们姑且通俗地称其为“n 选1”),我们也可以使用联合体来发挥其长处。首先看一段代码:union myun { struct { int x; int y; int z; }u; int k; }a; int main() { a.转载 2015-07-27 18:37:25 · 1059 阅读 · 0 评论 -
浅谈C++中指针和引用的区别
指针和引用在C++中很常用,但是对于它们之间的区别很多初学者都不是太熟悉,下面来谈谈他们2者之间的区别和用法。1.指针和引用的定义和性质区别:(1)指针:指针是一个变量,只不过这个变量存储的是一个地址,指向内存的一个存储单元;而引用跟原来的变量实质上是同一个东西,只不过是原变量的一个别名而已。如:int a=1;int *p=&a;int a=1;int &b=a;上面定义了一个整形变量和一个指针变转载 2015-08-01 11:21:43 · 377 阅读 · 0 评论 -
c# 程序后台运行
请把notifyIcon与button拖至窗口里后,在使用下面的代码 private bool windowsCreate = true; private void button3_Click(object sender, EventArgs e) //点击时会隐藏窗口 { if (windowsCreate) {转载 2015-10-11 23:50:19 · 6357 阅读 · 0 评论 -
OPENCV jpg图片合成avi视屏
环境:opencv2.4.10 VS2010申明:代码可能会有问题,但是确实实现的图片合成视屏,望广大网友指正。code:#include <opencv2/opencv.hp>using namespace std;using namespace cv;#include <stdio.h>int main(){ int num = 1; CvSize size = c原创 2016-03-23 13:41:31 · 3405 阅读 · 0 评论 -
localtime_r的实现
在ubuntu14.10 64位上测试通过#include <stdio.h>#include <time.h>#include <stdlib.h>#include <fstream>#include <string>#include <iostream>#include <sstream> //要使用stringstream流应包含此头文件//my_localtime_r转自(ht原创 2016-06-12 10:39:25 · 4822 阅读 · 0 评论