ChinaUnix.net
相关文章推荐:

cstring 查找字符串

本帖最后由 pypro 于 2010-07-19 20:20 编辑 好像不能用htonl转换cstring对象啊 cstringArray有没根据偏移分割数组 并返回分割好的数组的 ,把一个数组分成几个子数组的函数

by pypro - C/C++ - 2010-07-20 08:21:29 阅读(5099) 回复(5)

相关讨论

cstring C和cstring D 如何使cstring d d=C+D?????

by lovelylulu - C/C++ - 2003-06-13 16:29:26 阅读(966) 回复(6)

本帖最后由 gavinprogram 于 2011-01-10 13:14 编辑 #include #include <cstring> using namespace std; int main() { cstring str; cin>>str; cout<cstring 在此的作用域尚未声明。我头文件里包含cstring了呀 注:Linux下的cstring 名字是全小写的 我知道可以用string 但是Linux文件夹下默认自带有cstring头文件啊?不能用那人家应该不会放这里吧

cstringlinux

by gavinprogram - C/C++ - 2011-01-10 16:34:22 阅读(8209) 回复(11)

vc++ 环境下,关于string与cstring之间的转换问题, 如: string str = "test"; cstring cstr; cstr.Format(_T("%s"),str.c_str()); 结果cstr的值显示乱码,不是期望的"test" 请问这是怎么回事呀,string又怎么转换成cstring呢?

by olivia2007 - C/C++ - 2010-02-05 08:58:48 阅读(5951) 回复(2)

今天遇到一个难题,以前一直都是从TCHAR *转换到cstring,今天需要cstring 转换成TCHAR *的方法,找了一下MSDN文档,没有发现有现成的函数可以用。后来上网搜索了一下,方法还不少。如下几种: 方法一,使用强制转换。例如: cstring theString( "This is a test" ); LPTSTR lpsz =(LPTSTR)(LPCTSTR)theString;   方法二,使用strcpy。例如: cstring theString( "This is a test" ); LPTSTR lpsz = new TCHAR[theString.GetLe...

by poseidonqiu - Linux文档专区 - 2009-12-14 18:59:28 阅读(1712) 回复(0)

gdb调试过程如下,为什么打印tmp时显示的总是这种东西{m_pchData = 0xd5a1b0},怎样能打印出我赋它的字符串? Breakpoint 1, CRptMgrThread::RptExec (this=0x95504c8, data=0x953acf8) at RptMgrThread.cpp:224 224 cstring tmp = _T(""); Current language: auto; currently c++ (gdb) p tmp $1 = {m_pchData = 0x9526e8c} (gdb) n 225 tmp = GetPacketString((F...

by superlinux - Linux环境编程 - 2007-08-10 18:40:51 阅读(2492) 回复(2)

cstring是mfc的类,是不是不可以用在linux下面的呢?

by xiechunlu - C/C++ - 2006-11-20 20:59:04 阅读(1091) 回复(4)

请教各位高手:能否把cstring和int相互转化.eg:cstring A={2,3,4,5,6} ;int B[];如何才能使B[]={2,3,4,5};且是整形数组.可以转化吗?急切想知道答案!谢谢各位!

by redstarfu - C/C++ - 2006-10-30 17:05:17 阅读(2956) 回复(15)

一直都是用MS的开发工具,现在不得不转到 sco unix 下。搞了个把星期,才发现在 sco unix 下用 C++ 是一件很痛苦,很容易疑惑的事情。 用惯了MS 的 cstring 在 sco unix 找不到可以替代的方式,就连std::string 也没有,不得不自己定义这个类。 不知道各位大侠有没有已经定义好的这个类? 我现在自己也写了有一部分了,但因为是刚刚学会在unix 下编程,估计是写得不怎么样了,现在把代码传上来,也请高手指点。 还有,我想知道,...

by sashow - C/C++ - 2004-04-23 16:18:16 阅读(1231) 回复(4)

C++ String: How to convert between 'cstring' and 'std::string'? 'cstring' to 'std::string': std::string cannot always construct from a LPCTSTR i.e. the code will fail for UNICODE builds. So the following conversion will lead to error: cstring cs("Hello"); std::string s((LPCTSTR)cs); As std::string can construct only from LPSTR / LPCSTR, a programmer who uses VC++ 7.x or better can utilize conver...

by so_brave - C/C++ - 2011-06-07 17:04:18 阅读(2496) 回复(1)

cstring str; str = "hello,world"; printf("%s\n",str); 这个printf语句,在windows下行正确运行; 但我一直不知道这样调用它到底调用了那一个operator的转换? 我在Linux下写cstring类时,定义了 operator char*() 和operator const char*() 两个类型转换,可是 printf("%s\n",str);这种写法编译时警告通过,但运行时出现错误. 如果写成printf("%s\n",(char*)str);一切都OK了. 想问一下,windows下是如何实现的??

by jlmpp - Linux环境编程 - 2011-02-11 09:02:01 阅读(2101) 回复(3)