Click here to Skip to main content
15,923,120 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted

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.
 
Share this answer
 
Comments
Gbenbam 7-Feb-14 7:54am    
Thanks.I think the safest thing is to just use a cgi written in c++ in the website concerned.What do you think.
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.)
 
Share this answer
 
Comments
Gbenbam 7-Feb-14 10:54am    
Thanks a billion times.You just made my day.Now I know that php string is none other than a c/c++ null terminated string.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900