首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

在MAPLABD中遇到有关问题,

2012-03-02 
在MAPLABD中遇到问题,求救啊!!我在maplab想用sprintf函数,如下#includestring.h#includestdlib.hsprin

在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);

}
没有问题啊

热点排行