c - 关于“int”的问题。整数与 C 中的初始化
问题描述
我对在声明整数和使用它来初始化变量时如何区分“int”的使用感到困惑。
在以下示例中,我相信我正在初始化变量 n、m、y:
int main(void)
{
int n,m,y ;
}
如何区分“整数”和“初始化”
谢谢
解决方案
int foobar; //this is a declaration of an integer variable
foobar = 42; // this is assignment of the variable
int x = 52; // this is declaration and initialization in one line so you perform two things in this line: declaration and initialization to value 52
推荐阅读
- android - google playstore的apk名称
- asp.net-core - 在 Razor 视图上填充字段
- postgresql - 使用 dpage/pgadmin4 映像运行 docker-compose up 时获取权限异常
- javascript - 我正在从数据库中获取表数据并显示在表上,但数据表搜索不适用于数据
- java - Android - 将 GMT 时间转换为区域时间
- flutter - 使用 BLOC (flutter) 监听 firestore 集合变化的最小代码
- python - Pandas:查找每个间隔中最大连续零计数的平均值
- javascript - 为什么即使最大宽度设置为 100%,我的 (json) 图像也会超出边界/容器?
- angular - Angular Reactive Form - 验证不起作用
- mysql - 如何在MySql中同时编写删除和更新查询的过程