NoFear
随笔 - 48, 文章 - 0, 评论 - 6, 阅读 - 58938

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

02 2012 档案

摘要:View Code #include <stdio.h>class Singleton{public: static Singleton* Intance() { if(!mSingleTon) mSingleTon=new Singleton(); return mSingleTon; }protected: Singleton() { printf("object init"); }private: static Singleton* mSingleTon;};Singleton* S... 阅读全文

posted @ 2012-02-24 20:02 Fear_Hao 阅读(167) 评论(0) 推荐(0) 编辑

摘要:View Code 如果以最高位为符号位,二进制原码最大为01111111=2的7次方=127,最小为11111111=-2的7次方=-127此时0有两种表示方法,即正0和负0:00000000=10000000=0。所以,二进制原码表示时,范围是-127~-0和0~127,因为有两个零的存在,所以能表示不同的数值个数一共只有2的8次方-1个,而16位二进制能够表示的2的8次方个数值。 但是计算机中采用二进制补码存储数据,即正数编码不变,从00000000到01111111依旧表示0到127,而负数需要把除符号位以后的部分取反加1,即-127的补码为10000001。 到此,再来看原码... 阅读全文

posted @ 2012-02-16 19:54 Fear_Hao 阅读(251) 评论(0) 推荐(0) 编辑

摘要:View Code #pragma comment(lib,"user32")#include <windows.h>#include <time.h>char HHMM[6];time_t t;int i,r;int main() { while (1) { for (i=0;i<10;i++) Sleep(1000); time(&t); strftime(HHMM,6,"%H:%M",localtime(&t)); if (IDCANCEL==MessageBox(NULL,HHMM,"Tim 阅读全文

posted @ 2012-02-08 12:38 Fear_Hao 阅读(373) 评论(0) 推荐(0) 编辑

摘要:View Code #include <stdio.h>#include <string>#include <Windows.h>#include <Tlhelp32.h>DWORD GetProcessVid(char* lpName){ HANDLE hProcessSnap = NULL; BOOL bRet = FALSE; PROCESSENTRY32 pe32 = {0}; if(!lpName) { return 0; } hProcessSnap = CreateTo... 阅读全文

posted @ 2012-02-07 11:26 Fear_Hao 阅读(193) 评论(0) 推荐(0) 编辑

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