7,539
社区成员
发帖
与我相关
我的任务
分享
stringstream conv;
int a;
double b,c,d;
conv<<"20070116 110.55 21.21 -15.3 ";
conv>> a >>b >>c >>d ;
printf("%d %f %f %f",a,b,c,d);
CString s="20070116 110.55 21.21 -15.3 ";
char *p, *t;
/* Establish string and get the first token: */
t= s.GetBuffer(0);//把 CString 转化为纯字符串。所以 s 如果是字符串类型就更简单,不用转化了
p= strtok(t," ");
while( p != NULL )
{
/* While there are tokens in "string" */
MessageBox(p);
/* Get next token: */
p = strtok( NULL, " ");
}