当前位置:网站首页>[C exercise] what is the output result of the following code
[C exercise] what is the output result of the following code
2022-07-18 01:40:00 【Domeecky】
#include <stdio.h>
int i;
int main()
{
i--;
if (i > sizeof(i))
{
printf(">\n");
}
else
{
printf("<\n");
}
return 0;
}answer :‘>’
Global variables are placed in the static area , The default initialization is 0;
Local variables are placed in the stack area , If you don't initialize it when you create it, it contains random values ;
sizeof The return type of is size_t, Is an unsigned integer ;
i - - be equal to - 1;
Arithmetic conversion occurs when a negative number is compared with an unsigned integer , Convert a negative number to an unsigned integer , and -1 The unsigned integer of is very large , So the end result is ‘>’.
边栏推荐
猜你喜欢

【C】 Address of array

【C】实用调试技巧

Online variety show was cold: "Aiyou tengmang" couldn't be put away, "shake up B" couldn't win

今日睡眠质量记录80分

Redis profile

030. deletion and link of documents

Cloud mall source code repair 30 sets of templates to support one click docking of major systems

STM32 application development practice tutorial: application development of environmental light intensity monitoring

Matlab low-level source code realizes Prewitt edge detection and Sobel, Laplace edge detection (the implementation effect is consistent with Halcon)

nosql概述
随机推荐
Common SQL statements, stored procedures and functions
树莓派远程 桌面显示不全
数据湖(十七):Flink与Iceberg整合DataStream API操作
从0开始的 TypeScriptの十四:内置工具类型
AB test command
029. Copying and moving of documents
TCP/IP协议常见漏洞类型
【C 练习】打印‘X’图形
System. Use of arraycopy and detailed explanation of parameter meaning
树莓派 安装 opencv 环境,解决NO module named ‘cv2’
去掉CocosCreator自带的加载界面
cdn加速是什么
今日睡眠质量记录80分
内部类
C. K-beautiful Strings
读书的思考
Codeforces Round #806 (Div. 4)
Halcon常用图像预处理算子总结
redis持久化——rdb
Restore of data encryption returned by a website