问题描述
你好,我可以将类型String转换为char * ??
我需要在我的应用程序中使用fstream和openfiledialog。
谢谢,
Maciek
std :: string foo =" bar";
char * wombat = strdup(foo.c_str());
Leon Mergen
1)请不要发帖。
把你的回复放在文本下面你回复了
2)C ++ *中的字符串类是* std :: string
标准C ++中没有其他字符串类。
如果你使用其他类,请询问那个
类的创建者怎么做,或者发布到那个类我的新闻组局部。
-
Karl Heinz Buchegger
Hallo,
Can I convert type String to char* ??
I need to use fstream in my application together with openfiledialog.
Thanks,
Maciek
std::string foo = "bar";
char * wombat = strdup ( foo.c_str() );
Regards,
Leon Mergen
std::string foo = "bar";
char * wombat = strdup ( foo.c_str() );
Regards,
Leon Mergen
1) Please don''t top post.
Put your reply beneath the text you are replying to
2) the String Class in C++ *is* std::string
There is no other String Class in standard C++.
If you use some other class, please ask the creators of that
class how to do it, or post to a newsgroup where that class is topical.
--
Karl Heinz Buchegger
kb******@gascad.at
这篇关于字符串到char *的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!