请问atoi(s.c_str())这个函数怎么用?
C++里的谢谢
请看函数原型 int atoi(const char *); 字符串转换为整数。 把 char* 例如 是“123” : int a = atoi("123"); a 就等于 123
答:void stat(char *str) { int n1,n2,n3,n4; n1 = n2 = n3 = n4 = 0; while (*str) { if...详情>>
问:挺简单的一C函数,不过我是初学者,暂时还不会写,请好心人多多帮忙!
答:int mystrlen(char *str) { int n = 0; while (*str) { n++; str++;} return n; } voi...详情>>