kevin55

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  101 随笔 :: 0 文章 :: 25 评论 :: 24万 阅读

05 2012 档案

摘要:#include "stdafx.h"#include <stdio.h> #include <fcntl.h> #include <io.h> #include <iostream> #include <fstream>#include <conio.h>#ifndef _USE_OLD_IOSTREAMS using namespace std; #endif // maximum mumber of lines the output console should have static const 阅读全文
posted @ 2012-05-21 22:18 kernel_main 阅读(1870) 评论(1) 推荐(0) 编辑

摘要:#include "stdafx.h"#include "SerialPort.h"#include "assert.h"CSerialPort::CSerialPort(){ memset(&m_OverlappedRead, 0, sizeof(m_OverlappedRead)); memset(&m_OverlappedWrite, 0, sizeof(m_OverlappedWrite)); m_bOpened = false; m_ReadComThread = NULL; m_hIDCom = NULL; 阅读全文
posted @ 2012-05-20 11:10 kernel_main 阅读(658) 评论(0) 推荐(0) 编辑

摘要:1 #include "stdafx.h" 2 #include "Sms.h" 3 #include "Comm.h" 4 5 // 可打印字符串转换为字节数据 6 // 如:"C8329BFD0E01" --> {0xC8, 0x32, 0x9B, 0xFD, 0x0E, 0x01} 7 // 输入: pSrc - 源字符串指针 8 // nSrcLength - 源字符串长度 9 // 输出: pDst - 目标数据指针 10 // 返回: 目标数据长度 11 int gsmString2Bytes(c 阅读全文
posted @ 2012-05-20 11:09 kernel_main 阅读(2240) 评论(0) 推荐(0) 编辑

摘要:一、问题的提出编写一个耗时的单线程程序: 新建一个基于对话框的应用程序SingleThread,在主对话框IDD_SINGLETHREAD_DIALOG添加一个按钮,ID为IDC_SLEEP_SIX_SECOND,标题为“延时6秒”,添加按钮的响应函数,代码如下: void CSingleThreadDlg::OnSleepSixSecond() { Sleep(6000); //延时6秒}编译并运行应用程序,单击“延时6秒”按钮,你就会发现在这6秒期间程序就象“死机”一样,不在响应其它消息。为了更好地处理这种耗时的操作,我们有必要学习——多线程编程。二、多线程概述 进程和... 阅读全文
posted @ 2012-05-20 00:11 kernel_main 阅读(311) 评论(1) 推荐(0) 编辑

摘要:#include <iostream>#include <list>using namespace std;int main(){ char cTemp; list<char> charlist; for(int i=0;i<5;i+=3) { cTemp='a'+i;//ASCII值加i charlist.push_front(cTemp); } cout << "list old:" <<endl; list<char>::iterator it; for(it=charlis 阅读全文
posted @ 2012-05-12 23:32 kernel_main 阅读(687) 评论(0) 推荐(0) 编辑

摘要:// FindFile.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <io.h>#include <string.h>#include <iostream.h>const int MAXLEN = 1024; //定义最大目录长度unsigned long FILECOUNT = 0; //记录文件数量void ListDir(const char* pchData,const char * pFileNam 阅读全文
posted @ 2012-05-12 23:28 kernel_main 阅读(1163) 评论(0) 推荐(0) 编辑

摘要:静态库(.a):程序在编译链接的时候把库的代码链接到可执行文件中。程序运行的时候将不再需要静态库。动态库(.so或.sa):程序在运行的时候才去链接共享库的代码,多个程序共享使用库的代码。 阅读全文
posted @ 2012-05-02 23:11 kernel_main 阅读(269) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示