本文概要:通过一个简单的Qt程序来介绍Qt程序编写的基本框架与一些Qt程序中常见的概念#include #include int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button...
分类:
其他好文 时间:
2015-04-10 23:57:43
阅读次数:
257
在main.m文件中:#import #import "MJAppDelegate.h"int main(int argc, char * argv[]){ @autoreleasepool { /* argc: 系统或者用户传入的参数个数 arg...
分类:
移动开发 时间:
2015-04-10 21:57:38
阅读次数:
171
原理:异或运算加密:#include#include#include#define KEY '@'int main(int argc, char * argv[]){ FILE *fp; FILE *coded; char codedname[40]; char ch; ...
分类:
编程语言 时间:
2015-04-10 19:59:57
阅读次数:
162
不使用sizeof,求某机器平台的int型整数位数(16,32,64)
思路,将整数变成字符串处理,并且在内存的末尾填零,即字符串结束符。
如 0x0012,0x00123456,0x00123456789ABCDE分别对应16,32,64位数; 小端机
代码
#include
#include
int main(int argc , char *argv[])
{
...
分类:
其他好文 时间:
2015-04-10 11:34:20
阅读次数:
191
先看一个父进程向子进程发kill信号例子:
#include
#include
#include
#include
#include
int main(int argc, const char *argv[])
{
pid_t pid;
int status;
pid = fork();
if (0 == pid)
{
pri...
分类:
系统相关 时间:
2015-04-09 19:52:28
阅读次数:
150
main -> ngx_save_argv创造一个包含argc个地址空间的数组ngx_argv,然后为ngx_argv每个地址空间分配argv[i]大小的空间,并将argv[i]拷贝入ngx_argv[i]指向的地址空间main -> ngx_process_options调用ngx_pnalloc...
分类:
其他好文 时间:
2015-04-09 15:27:04
阅读次数:
160
TCP server端#include "stdafx.h"#include #include #pragma comment(lib,"ws2_32.lib")int main(int argc, char* argv[]){ //初始化WSA WORD sockVersion = M...
分类:
其他好文 时间:
2015-04-08 14:37:38
阅读次数:
161
1,Ubuntu已经安装了gstreamer库,因此只需要再安装几个开发库即可,是libstreamer0.10-0libstreamer0.10-devlibstreamer0.10-0-dbg在新立得里选中应用即可2,测试gstreamer开发库#include gst/gst.h>int main (int argc,char *argv[]){ const gchar *nano...
分类:
系统相关 时间:
2015-04-07 19:43:47
阅读次数:
155
在Linux下编写一下代码:
#include
#include
char Lbuffer[] = "01234567890123456789========ABCD";
void foo()
{
char buff[16];
strcpy (buff, Lbuffer);
}
int main(int argc, char * argv[])
{
foo();...
分类:
其他好文 时间:
2015-04-07 19:40:53
阅读次数:
128
//// main.m// 时间格式化////#import int main(int argc, const char * argv[]) { @autoreleasepool { //返回当前时间,以GMT为准 NSDate * date =...
分类:
其他好文 时间:
2015-04-07 19:03:38
阅读次数:
98