摘要: 几点说明:(1)发送的数据不能有空格;(2)这是控制台应用程序;1、UserMesInfo.h 公共文件,客户端和服务器端公用; 1 #ifndef User_Mes_Sock 2 #define User_Mes_Sock 3 #include <winsock2.h> 4 #endif 5 6 const short MesLogin = 1001; 7 const short MesError = 1002; 8 const short MesNormal = 1003; 9 const short LoginSuc = 1004;10 const s... 阅读全文
posted @ 2012-11-17 22:17 china_victory 阅读(12196) 评论(4) 推荐(1) 编辑
摘要: (一)基本概念:1、类与对象:1 //声明类2 class Human {3 4 //... Data members and methods go here5 6 };7 8 //定义对象9 Human human; 2、通常用class声明类,struct也可以,只不过在信息隐藏机制上有点区别;struct默认是public,而class默认是private;只能在类的成员函数或friend函数中访问类的非公有成员;3、成员选择符:' . ' 和 ' -> ';4、成员函数的定义: 两种方式:一种在类内定义,所定义的成员函数都是inline类型的;一种 阅读全文
posted @ 2012-11-17 10:11 china_victory 阅读(287) 评论(0) 推荐(0) 编辑