在MAPLABD中遇到问题,求救啊!!
我在maplab想用sprintf函数,如下
#include <string.h>
#include <stdlib.h>
sprintf( buff, "%02d%02d%02d ", a, b, c );
a,b,c都是小于100的整数
但编译通不过!!
[解决办法]
#include <string>
#include <iostream>
using namespace std;
void main()
{
char buff[100];
int a=99 ,b=44,c=98;
sprintf( buff, "%02d%02d%02d ", a, b, c );
printf( "%s ",buff);
}
没有问题啊