共2条
1/1 1 跳转至页
sprintf 关于sprintf()函数的原型.
问
我在"D:\Program Files\ARM\ADSv1_2\Include"下面找到了一个stdio.h文件,它对对这个函数是这样说的:
extern int sprintf(char * /*s*/, const char * /*format*/, ...);
/*
* is equivalent to fprintf, except that the argument s specifies an array
* into which the generated output is to be written, rather than to a
* stream. A null character is written at the end of the characters written;
* it is not counted as part of the returned sum.
* Returns: the number of characters written to the array, not counting the
* terminating null character.
*/
我在引用的时候是这样的用的:
sprintf(string,"%4dvVin0",ADC_Data00);
没有问题!
但是我现在迫切想了解一下,它的具体源码是什么样的,有哪为大哥可以帮帮我?
答 1: re:
为什么我AXD执行这条语句的时候会死在这里????当我停下来的时候,发现执行光标指在数据异常取指的地方!编译的时候,没有任何问题!
sprintf(str, "%4d mV VIN3", ADC_Data);//已经在头文件里包含了 stdio.h
我上午用的时候还没有问题呢?下午试的时候就出现了这问题!!!
求个位大哥,给个说法!??????
我在"D:\Program Files\ARM\ADSv1_2\Include"下面找到了一个stdio.h文件,它对对这个函数是这样说的:
extern int sprintf(char * /*s*/, const char * /*format*/, ...);
/*
* is equivalent to fprintf, except that the argument s specifies an array
* into which the generated output is to be written, rather than to a
* stream. A null character is written at the end of the characters written;
* it is not counted as part of the returned sum.
* Returns: the number of characters written to the array, not counting the
* terminating null character.
*/
我在引用的时候是这样的用的:
sprintf(string,"%4dvVin0",ADC_Data00);
没有问题!
但是我现在迫切想了解一下,它的具体源码是什么样的,有哪为大哥可以帮帮我?
答 1: re:
为什么我AXD执行这条语句的时候会死在这里????当我停下来的时候,发现执行光标指在数据异常取指的地方!编译的时候,没有任何问题!
sprintf(str, "%4d mV VIN3", ADC_Data);//已经在头文件里包含了 stdio.h
我上午用的时候还没有问题呢?下午试的时候就出现了这问题!!!
求个位大哥,给个说法!??????
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
东芝TB6560AHQ步进电机驱动器芯片 | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
【有奖活动】智能可穿戴设备AR/VR如何引领科技新潮流! | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 |
打赏帖 | |
---|---|
【换取手持数字示波器】+AT89C2051串口接收数据显示到LCD1602上被打赏50分 | |
【分享评测,赢取加热台】+AT89C2051控制NRF24L01收发数据被打赏50分 | |
【分享评测,赢取加热台】迪文屏设计实战技巧被打赏40分 | |
“DFRobot盖革计数器模块评测”基础模型搭建被打赏50分 | |
【换取手持数字示波器】+角点检测----Harris被打赏40分 | |
【换取手持数字示波器】常见音频指标被打赏20分 | |
【分享评测,赢取加热台】从零配置MCX-N947——PWM(SCtimer)被打赏50分 | |
【分享评测,赢取加热台】实际测试MCX-N947——PWM(Ctimer)被打赏50分 | |
【换取手持数字示波器】红外触摸框及各类红外设备的工作原理被打赏20分 | |
【换取手持数字示波器】+精英板驱动两相四线步进电机被打赏10分 |