+ -
当前位置:首页 → 问答吧 → cstring字符串怎么转为网络字节序啊?CStringArray有没有能分割数组的函数啊?

cstring字符串怎么转为网络字节序啊?CStringArray有没有能分割数组的函数啊?

时间:2010-07-19

来源:互联网

本帖最后由 pypro 于 2010-07-19 20:20 编辑

好像不能用htonl转换cstring对象啊

CStringArray有没根据偏移分割数组 并返回分割好的数组的 ,把一个数组分成几个子数组的函数

作者: pypro   发布时间: 2010-07-19

UPUP

作者: pypro   发布时间: 2010-07-19

没用过这么高级的东西, 只会用char的路过……

作者: mgqw   发布时间: 2010-07-19

字符串还转个什么,本身就是char数组,网络本地都一样的,不需要转。
宽字符串才需要转。

至于字符串长度自己定协议吧。

作者: 没本   发布时间: 2010-07-19

回复 没本

直接转的时候会提示错误啊

error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CString' (or there is no acceptable conversion)

这样写的
CString ip="192.168.0.1";
addrSrv.sin_addr.S_un.S_addr=ip;

作者: pypro   发布时间: 2010-07-19