|
在 Visual Studio 里写 C++ 程序,编译通过后再移植到 STM32 CubeIDE。我写了一个简单的 for 循环, for(int z=5;z<15;z++) { cout<<"when z is equal to 10, the loop will be broken out\n"; if(z==10) { break; } cout<<z<<endl; } cout<<z<<endl; 运行后变量 z 在循环体外输出了奇怪的值:1971940899。 终端输出如下: when z is equal to 10, the loop will be broken out 5 when z is equal to 10, the loop will be broken out 6 when z is equal to 10, the loop will be broken out 7 when z is equal to 10, the loop will be broken out 8 when z is equal to 10, the loop will be broken out 9 when z is equal to 10, the loop will be broken out 1971940899 |
强制类型转换不起作用
STM32 VSCode 扩展插件问题
在 CubeIDE 中为不同 RAM 区域定义带初始值的全局变量
FreeRTOS中为什么要以这种宏定义方式访问指定地址的值
当程序里有 while (1) 死循环时,main 函数还需要 return 0 吗?
编译器在结构体中插入了并不存在的 16 位变量?
第三方库尺寸评估
给变量赋值二进制数值无效
STM32CubeIDE 构建后运行脚本与路径中包含引号
int 与 float 之间的转换
微信公众号
手机版
因为z==10,直接break了这个for循环,而z的生命周期只在这个for循环内,break后就销毁了,出现什么值都是未知的