Questions tagged «const-char»

9
如何从int转换为char *?
我知道的唯一方法是: #include <sstream> #include <string.h> using namespace std; int main() { int number=33; stringstream strs; strs << number; string temp_str = strs.str(); char* char_type = (char*) temp_str.c_str(); } 但是,有没有一种方法可以减少打字?

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.