怎么样将类似"100,100"的字符串转化成两个整数100
怎么样将类似"100,100"的字符串转化成两个整数100
#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编辑过]