Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何在 C 中将整数转换为字符串?
我想计算字符串的长度并将值作为字符串传递给函数。
char* s="abcd"; int i = strlen(s); char* lengthAsString = ????(i);
char* s = "abcd"; int i = strlen(s); char lengthAsString[50]; sprintf(lengthAsString, "%d", i); // now you can use lengthAsString to pass it to a function