01 2007 档案
摘要://C++ 中的可变参数使用#include <stdio.h>#include <stdarg.h>intOpenFileArray(FILE***array,char*mode,char*filename,...){ char*pName=NULL; intnrFiles=0; intarrayIndex=0; if(filename==NULL){ return0; } //在参数表中创建一个索引使用的typedef va_listlistIndex; //在参数表中初始化第一个参数索引的宏 va_start(listIndex,filename); do{ ..
阅读全文
摘要:#include <iostream.h>structA{ chara;longb;charc;longd;};structB{ chara;charc;longb;longd;};#pragma pack(push, 1)structC{ chara;longb;charc;longd;};#pragma pack(pop)structD{ char*a;char*b;};//使用比特域的结构structBitField{ unsigneda1:11; //long 1 unsigneda2:11; unsignedb1:10; unsigneda3:11; //long 2..
阅读全文
摘要:在这本书的最后一章提到算法的陷阱的时候举了几个例子,记下两个。1. 循环计数的覆盖如果把1加到数值为255的字节上,该字节就会变为0。unsignedchari;for(i=0;i<256;i++){ cout<<"test"<<(int)i<<endl;}这就会出现一个死循环了,因为255之后再加一就又为0了。2. 数组和继承的混用#include <iostream.h>classAverageJoe{public: longid;};classJetSet:publicAverageJoe{public: long
阅读全文
摘要:在VC++ 6.0 中使用_beginthread 和 _endthread 的时候,出现如下错误:error C2065: '_beginthread' : undeclared identifiererror C2065: '_endthread' : undeclared identifier解决方案:debug状态:settings->C/C++->Project Options中加入/MDdrelease状态:settings->C/C++->Project Options中加入/MD如果还不行,可以修改以下选项:project
阅读全文
摘要:Windows Live Writer最新版支持很多blog系统,当然包括google的blogger。不过设置的时候偶遇到一点点麻烦,居然在Windows Live Writer帮助里没找到解决方案,后来总算试出来了,呵呵在此列出设置blogger 和博客园(cnblogs)的方法:1. 设置Blogger首先填写blog地址、用户名、密码,无甚可说,然后在“Type of weblog that you are using”中选择“blogger”,最让人难以捉摸的是下面的“Remote posting URL foryour weblog”,其实只要你把自己blogger最下面的Post
阅读全文

浙公网安备 33010602011771号