摘要: 定义一个类一般都是在头文件中进行类声明,在cpp文件中实现,但使用模板时应注意目前的C++编译器还无法分离编译,最好将实现代码和声明代码均放在头文件中。如:test.htemplate <class T>class CTest{ public: T& GetValue(); void SetValue(const T& _Value);protected: T m_Value;};test.cpptemplate <class T>T& CTest<T>::GetValue(){ return m_Value; }template&l 阅读全文
posted @ 2011-09-22 12:23 byfei 阅读(277) 评论(0) 推荐(0) 编辑
摘要: #include <string.h>#include <iostream>using namespace std;int main(){char d[256]="hello";//char *s=" word";char s[256]=" word";strcat(d,s);cout<<d;getchar();return 0;} 阅读全文
posted @ 2011-09-21 11:48 byfei 阅读(253) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <vector>using namespace std;struct NODE{int m_nRoleID;int m_nScore;string m_strROleName;NODE() :m_nRoleID(1), m_nScore(0),m_strROleName("byfei"){}NODE(const int nRoleID, const int nScore,const string strRoleName) :m_nRoleID(nRoleID), m_nScore(nScore) 阅读全文
posted @ 2011-09-21 10:33 byfei 阅读(734) 评论(0) 推荐(0) 编辑
摘要: 1.声明: 一个vector类似于一个动态的一维数组。 vector a; //声明一个元素为int类型的vector a vectot a; //声明一个元素为MyType类型的vector a 这里的声明的a包含0个元素,既a.size()的值为0... 阅读全文
posted @ 2011-09-21 10:33 byfei 阅读(59) 评论(0) 推荐(0) 编辑
摘要: virtualbox 4.08安装虚机Ubuntu11.04增强功能失败解决方法 引用 fuliang@fuliang-VirtualBox:~$ sudo /etc/init.d/vboxadd setup Removing existing Virtual... 阅读全文
posted @ 2011-09-14 17:32 byfei 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 引用fuliang@fuliang-VirtualBox:~$ sudo /etc/init.d/vboxadd setup Removing existing VirtualBox DKMS kernel modules ...done. Removing existing VirtualBox non-DKMS kernel modules ...done. Building the VirtualBox Guest Additions kernel modules The headers for the current running kernel were not found. If 阅读全文
posted @ 2011-09-14 17:31 byfei 阅读(410) 评论(0) 推荐(0) 编辑
摘要: #include <fstream>#include <iostream>#include <stdlib.h>#include <vector>#include <string>#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <errno.h>#include <sys/file.h># 阅读全文
posted @ 2011-08-26 16:28 byfei 阅读(1433) 评论(0) 推荐(0) 编辑
摘要: 命令行下输入:convert X: /fs:ntfs可将FAT格式转换为NTFS格式.X:为要转换的盘符.例如把C盘转成ntfs格式:convert c: /fs:ntfs也能转U盘 阅读全文
posted @ 2011-08-19 10:07 byfei 阅读(125) 评论(0) 推荐(0) 编辑
摘要: error C2061: 语法错误 : 标识符“CString”#include <afx.h> 阅读全文
posted @ 2011-08-19 10:04 byfei 阅读(992) 评论(0) 推荐(0) 编辑
摘要: 1.新建一个文件夹2.把要转换的图片全放在这个文件里3.在这个文件中新建个TXT文件4.在TXT文件中输入@ren *.pif *.gif PIF代表现在的格式GIF代表要转换的格式5.把TXT文件重名为BAT文件6.双击BAT文件就OK了 阅读全文
posted @ 2011-08-19 10:04 byfei 阅读(151) 评论(0) 推荐(0) 编辑