当前位置:网站首页>Array integration initialization (C language)
Array integration initialization (C language)
2022-07-05 08:15:00 【chen_ bx】
1. Initialize to 0 The size is 13 Array of
#include <stdio.h>
int main()
{
int i;
int a[13] = {
0 };
for (i = 0; i < 13; i++) {
printf("%d\t", a[i]);
}
}
2. The size is 13 Array of , Initializing page 6 The number is 6 And the 9 First paragraph 10 The number is 9 and 10, The other numbers are 0
Applicable to a large number of 0, Initialization of arrays with only a few values
#include <stdio.h>
int main()
{
int i;
int a[13] = {
[5]=6,[8]=9,10 };
for (i = 0; i < 13; i++) {
printf("%d\t", a[i]);
}
}
边栏推荐
- VESC Benjamin test motor parameters
- Imx6ull bare metal development learning 1-assembly lit LED
- Extern keyword function
- LED display equipment records of the opening ceremony of the Beijing Winter Olympics
- Zero length array in GNU C
- Gradle composite construction
- Drive LED -- GPIO control
- Simple design description of MIC circuit of ECM mobile phone
- Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev
- MySQL之MHA高可用集群
猜你喜欢
Compilation warning solution sorting in Quartus II
C language # and #
Semiconductor devices (III) FET
Let's briefly talk about the chips commonly used in mobile phones - OVP chips
Nb-iot technical summary
Consul installation
FIO测试硬盘性能参数和实例详细总结(附源码)
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
[cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl
Management and use of DokuWiki (supplementary)
随机推荐
Several implementation schemes of anti reverse connection protection of positive and negative poles of power supply!
Simple design description of MIC circuit of ECM mobile phone
VESC Benjamin test motor parameters
Hardware 3 -- function of voltage follower
UEFI development learning series
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
Management and use of DokuWiki (supplementary)
【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
Volatile of C language
C WinForm [display real-time time in the status bar] - practical exercise 1
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
Design a clock frequency division circuit that can be switched arbitrarily
OC and OD gate circuit
UEFI development learning 3 - create UEFI program
Introduction of air gap, etc
Nb-iot technical summary
H264 (I) i/p/b frame gop/idr/ and other parameters
Create inf module in AMI code
Basic embedded concepts
Solutions to compilation warnings in Quartus II