07 2011 档案

关于利用 iconv 跨平台转编码问题
摘要:string name = "Ambition";GBKToUTF8(name,"GBK","UTF-8"); //需要转换什么编码只需要更改后面2个参数。万能的(嘎嘎。。。。)游戏开发群:44727718int JCStrCoding::GBKToUTF8(string &gbkStr,const char* toCode/*="gbk"*/,const char* fromCode/*="utf-8"*/){ iconv_t iconvH; iconvH = iconv_open(f 阅读全文

posted @ 2011-07-23 12:29 游戏开发:主席 阅读(523) 评论(0) 推荐(1) 编辑

google protobuf 使用心德
摘要:最近我们开发过程中用到google/protobuf,因为之前没有接触过。网上的资料都是互相复制转载的。基本上都是讲protobuf 怎么赋值怎么取值。。。主要的消息映射讲的微乎其微。。。。。我根据网上说的做了下。。。问题我纠缠死了。。。-_-# OK 看代码 1 GOOGLE_PROTOBUF_VERIFY_VERSION; 2 string str = ""; 3 4 tutorial::AddressBook address_book; 5 tutorial::Person *person = tutorial::Person::default_instance(). 阅读全文

posted @ 2011-07-20 11:38 游戏开发:主席 阅读(954) 评论(0) 推荐(1) 编辑

c++和java字节高低位的转换
摘要:现在我们需要从一个C/C++语言生成的二进制文件中读出一个float数据Java代码//参见java.io.DataInputStream //C++写入的字节顺序是从低到高(左低到右高), 而java.io.DataInputStream读取的数据是从高到低(左高到右低) //所以需要自己改写一下 //功能和java.io.DataInputStream类似的 publicclassCppInputStreamextendsFilterInputStream{ publicCppInputStream(InputStreamin){ super(in); } publicfinalintre 阅读全文

posted @ 2011-07-06 13:56 游戏开发:主席 阅读(9643) 评论(0) 推荐(0) 编辑

BSD Sockets API 编程
摘要:intsocket(int family, int type, int protocol);Creates a socket. Currentlyfamilycan only beAF_INET(OT does not support IPv6 so there is no AF_INET6 support).protocolcan bePF_INETorPF_UNSPEC(both have the same effect of creating an internet socket.typecan beSOCK_STREAMfor TCP sockets orSOCK_DGRAMfor U 阅读全文

posted @ 2011-07-04 17:21 游戏开发:主席 阅读(1673) 评论(1) 推荐(1) 编辑

< 2025年4月 >
30 31 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 1 2 3
4 5 6 7 8 9 10

导航

统计

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