int main (void)
{
uint8_t i;
uint8_t buf[10] = {33,34,35,0};
/*!< At this stage the microcontroller clock setting is already configured,
this is done through SystemInit() function which is called from startup
file (startup_stm32f10x_xx.s) before to branch to application main.
To reconfigure the default setting of SystemInit() function, refer to
system_stm32f10x.c file
*/
i = i;
i = 0;
buf[0] = 33;
buf[1] = 36;
数组定义的时候直接赋值全0试试:uint8_t buf[10]={0};
仿真结果还是一样
这数组是存放在什么地方的,贴出完整的程序吧。
#include "includes.h"
int main (void)
{
uint8_t i;
uint8_t buf[10] = {33,34,35,0};
/*!< At this stage the microcontroller clock setting is already configured,
this is done through SystemInit() function which is called from startup
file (startup_stm32f10x_xx.s) before to branch to application main.
To reconfigure the default setting of SystemInit() function, refer to
system_stm32f10x.c file
*/
i = i;
i = 0;
buf[0] = 33;
buf[1] = 36;
sprintf((char*)&buf, "!#$");
// buf = {}
// buf[2] = 0;
sprintf((char*)&buf, "文");
while(1)
{
}
}
/**********************ends of file*******************************************/
这数组是存放在什么地方的,贴出完整的程序吧。
没有什么特殊的地方,也没做特殊处理只是简单赋值。空工程
一周热门 更多>