当前位置:网站首页>Initialize the one-dimensional array a correctly
Initialize the one-dimensional array a correctly
2022-06-11 02:00:00 【Jihai】
double arr[0];1. There should be at least one element in the array [] Should be greater than or equal to 1;
int N=6,str[N];2. For details, see
int a[10]=(0,0,0);
3. You should use curly braces
int a[10]={};4.,
Although grammatically correct , But we don't usually write that , Because of poor readability , Some people don't know , You may think it is a grammatical error , So it is generally written as follows :
int a[10]={ 0 }; / / It's an array a All elements in are assigned initial values 0.
Of course , If you write like this int a[10]={ 1 }; / / He just assigns a value to the first element of the array 1 nothing more , Other values are 0. This is a C/C++ A mechanism problem of , There is no need to delve into .
int a[10]={10*1};5.
边栏推荐
- How to reinstall win11 drawing tool when it is missing
- kubernetes 二进制安装(v1.20.15)(七)加塞一个工作节点
- AI fanaticism | come to this conference and work together on the new tools of AI!
- Kubernetes binary installation (v1.20.15) (VII) plug a work node
- 2.0 detailed explanation of ROS and Px4 communication
- [leetcode] merge K ascending linked lists
- [Haas hands on] creative case of new video program launch we started the first phase together E01: Internet of things engineers started the remote control manipulator with you
- Metersphere tutorial: how to assert when the returned result of the interface is null
- 爱思唯尔---Elseviewer---预印本在线发表通知
- 今日睡眠质量记录80分
猜你喜欢

晚餐阿帮的手艺

Win11触摸键盘主题如何更换?Win11更换触摸键盘主题的方法
![[leetcode] restore binary search tree](/img/92/14c4d670f318f93297040241a61c41.jpg)
[leetcode] restore binary search tree

Loki 学习总结(1)—— Loki 中小项目日志系统的不二之选

Video compression data set TVD

Today's sleep quality record 80 points

Task02: basic use of database (MySQL)

關於概率統計中的排列組合

ACM tutorial - heap sorting

(solved) latex -- cancel the superscript display of references in the text (gbt7714-2015 will lead to the default superscript reference) (tutorial on mixed use of superscript and flush)
随机推荐
[leetcode] different binary search trees (recursion - recursion + memory search optimization - dynamic programming)
[leetcode] balanced binary tree
The argument type ‘int?‘ can‘t be assigned to the parameter type ‘num‘
LeetCode 1749 Maximum Absolute Sum of Any Subarray (dp)
Xpath注入
【Qt】error: QApplication: No such file or directory 解决方案
AI 狂想|来这场大会,一起盘盘 AI 的新工具!
Elsevier ---elseviewer--- preprint online publishing notice
【MATLAB】图像复原
Deep exploration of functions with indefinite parameters in C language
数据库概述
1.3 introduction to ROS UAV
Kubernetes binary installation (v1.20.15) (VII) plug a work node
Leetcode 652 find duplicate subtrees (recommended by DFS)
【HaaS Hands-On】全新视频节目上线 创意案例我们一起上手做 第一期E01: 物联网工程师 和你一起上手做遥控机械臂
Task03: stack
Task06: bit operation
Xpath Injection
[image processing] multi functional image processing system based on Matlab GUI [including Matlab source code 1876]
2021-07-18 ROS notes - basics and communication