哪个c ++字符串类型相当于PHP字符串类型(即哪个c ++ null终止字符串和c ++字符串对象相当于PHP字符串? [英] Which c++ string type is equivalent to PHP string type( i.e which of c++ null terminated string and c++ string object is equivalent to PHP string?

查看:85
本文介绍了哪个c ++字符串类型相当于PHP字符串类型(即哪个c ++ null终止字符串和c ++字符串对象相当于PHP字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪个c ++字符串类型相当于PHP字符串类型(即哪个c ++ null终止字符串和c ++字符串对象等同于PHP字符串?

Which c++ string type is equivalent to PHP string type( i.e which of c++ null terminated string and c++ string object is equivalent to PHP string?

推荐答案

C ++ 提供 std :: string 。它不是 NULL 终止了一个,但它提供了 c_str() [ ^ ]方法。当然 C ++ 可以使用 C 类似的字符串(这是一个以NULL结尾的字符数组),但我认为没有责任告诉你。
C++ provides std::string. It isn't a NULL terminated one, however it provides the c_str()[^] method. Of course C++ can work on C-like strings (that are NULL terminated character arrays) but I assume no resposibility for having told you.


如果你正在编写一个PHP扩展,你应该阅读 PHP内部页面 [ ^ ] - 特别是关于变量的页面。



(如果你没有编写PHP扩展,那么我真的不知道字符串的类型如何重要。)
If you're writing a PHP extension, you should read through the PHP internals pages[^] - particularly the pages on variables.

(If you're not writing a PHP extension, then I don't really see how the type of string matters.)


这篇关于哪个c ++字符串类型相当于PHP字符串类型(即哪个c ++ null终止字符串和c ++字符串对象相当于PHP字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆