DSP: F2812, CCS3.3
...
int par0=0,par1=0,par2=0;
...
inpstr="S 12 51 62";
sscanf(inpstr,"S %d %d %d",&par0,&par1,&par2);
结果不是:par0=12,par1=51,par2=62.
多谢!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
DSP: F2812, CCS3.3
...
int par0=0,par1=0,par2=0;
...
inpstr="S 12 51 62";
sscanf(inpstr,"S %d %d %d",&par0,&par1,&par2);
结果不是:par0=12,par1=51,par2=62.
多谢!
这样是可以,仍表感谢 !
能有办法直接从字串中分离出10进制整型,16进制整型吗 ?
//***************************************************************
楼主有#include "stdio.h"吗?
char* inpstr="S 12 51 62";
char kkk[5][10] = {{0},{0},{0},{0},{0}};
i=sscanf(inpstr,"S %s %s %s",&kkk[0],&kkk[1],&kkk[2]);
--------------------------------------------------------------------------------