怎么样将类似"100,100"的字符串转化成两个整数100
怎么样将类似"100,100"的字符串转化成两个整数100
2007-06-22 14:40
2007-06-22 15:23
2007-06-22 20:54
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
int main(void)
{
int n;
char *str = "124512.67";
n = atoi(str);
cout <<"string=";
printf("%d",n);
cout << " integer =";
printf("%d",n);
return 0;
}
[此贴子已经被作者于2007-6-22 21:26:40编辑过]
2007-06-22 21:08