C++
文章平均质量分 74
han897910256
这个作者很懒,什么都没留下…
展开
-
函数指针
// template函数.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include using namespace std;struct INFO{int Numb;char szName[20];float score;翻译 2016-04-07 19:00:55 · 240 阅读 · 0 评论 -
printf的初步了解
// printf的初步了解.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include int main1(int argc, char* argv[]){printf("hello world\n");//打印的是字符翻译 2016-08-21 20:58:59 · 637 阅读 · 0 评论 -
printf补充
// printf补充.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main0(int argc, char* argv[]){{unsigned short int unum=65535;//unsi翻译 2016-08-21 20:58:32 · 247 阅读 · 0 评论 -
sprintf sscanf用法
#include #include #include using namespace std;void main1(){char str[30]={0};int num;char op[30];scanf("%d%s",&num,op);sprintf(str,"for /l %%i in (1,1,%d) do %s",num,op);system(s翻译 2016-04-21 17:04:05 · 264 阅读 · 0 评论 -
CString类
CString类翻译 2016-04-17 09:29:21 · 227 阅读 · 0 评论 -
关于在构造函数初始化列表
#include "stdafx.h"class A{int x;int y;const int z;//必须在初始化列表上初始化int & ref;//必须在初始化列表上初始化public://初始时普通的成员变量是可以在构造函数内赋值的//而const 成员变量必须在初始化列表中赋值/*A():x(0),y(0),z(0),ref(x){翻译 2016-04-17 09:25:54 · 200 阅读 · 0 评论 -
Virtual 虚函数
#include "stdafx.h"#include using namespace std;class CBase{int m_i;public:void ReallFunc(){cout}virtual void VirtualFunc(){cout}};class CDerive:public CBase{翻译 2016-04-19 20:48:47 · 207 阅读 · 0 评论 -
CSockets类重写CSocket
#include #pragma comment (lib,"ws2_32.lib")class CSockets {private:SOCKET m_sock;public:CSockets();virtual ~CSockets();bool Creates( UINT nSocketPort=0,//端口int nSocketType翻译 2016-04-27 22:08:05 · 367 阅读 · 0 评论 -
初步认识继承
#include "stdafx.h"#include using namespace std;//构造方式跟类内类对象是一样的/*父类:INFO派生类:Sci ~派生类:~Sci ~父类:!INFO*/struct INFO //父类{//信息void inputINFO(){coutcin>>Numb翻译 2016-04-11 19:08:39 · 190 阅读 · 0 评论 -
memcpy和memove 编译已经去掉了memcpy
// Memcpy与Memmove.cpp : Defines the entry point for the console application.//#include "stdafx.h"void *hmemcpy( void *dest, const void *src, size_t count ){char *desbak=(char*)dest;翻译 2016-04-11 17:49:22 · 343 阅读 · 0 评论 -
CMap的模板
templateclass CMap {private:struct SNode{TYPE data;KEY key;SNode* pNext;};KEY RHash(REF_KEY key);KEY HashSize;SNode** m_Data;KEY m_Count;public:CMap(int Count=7){m_D翻译 2016-04-14 20:40:18 · 339 阅读 · 0 评论 -
CArray
#include using namespace std;#include template class CArray {private:int m_Size;int m_Count;TYPE *m_Data;public:int GetSize() const{return m_Size;}void RemoveAll(){m翻译 2016-04-08 21:32:45 · 305 阅读 · 0 评论 -
New
#include "stdafx.h"struct INFO{int Numb;char szName[20];float sorce;};//1.int *p代表一个int //int *p= new int[10] 只看*前面的类型就行了就一个int类型也就是开辟10个int的空间//new时一定要看清楚 *前面的类型来判断它的开辟的类型int翻译 2016-04-08 10:54:35 · 260 阅读 · 0 评论 -
sscanf数据挖取
// scanf的拓展.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include #include int main(int argc, char* argv[]){char name[10];long long IDcard=翻译 2016-08-23 21:24:41 · 376 阅读 · 0 评论