当前位置:网站首页>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]);
}
}

边栏推荐
- [trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
- Sizeof (function name) =?
- Wifi-802.11 negotiation rate table
- More than 90% of hardware engineers will encounter problems when MOS tubes are burned out!
- DCDC circuit - function of bootstrap capacitor
- LED display equipment records of the opening ceremony of the Beijing Winter Olympics
- Compilation warning solution sorting in Quartus II
- MySQL MHA high availability cluster
- C WinForm [display real-time time in the status bar] - practical exercise 1
- Hardware 1 -- relationship between gain and magnification
猜你喜欢

How to copy formatted notepad++ text?

Arduino uses nrf24l01+ communication

Solutions to compilation warnings in Quartus II

Hardware 3 -- function of voltage follower

More than 90% of hardware engineers will encounter problems when MOS tubes are burned out!

Keil use details -- magic wand

MySQL MHA high availability cluster

Hardware 1 -- relationship between gain and magnification

Factors affecting the quality of slip rings in production

Relationship between line voltage and phase voltage, line current and phase current
随机推荐
Record the opening ceremony of Beijing Winter Olympics with display equipment
C WinForm [view status bar -- statusstrip] - Practice 2
Summary of SIM card circuit knowledge
Carrier period, electrical speed, carrier period variation
Sizeof (function name) =?
Extern keyword function
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
Arduino uses nrf24l01+ communication
Charge pump boost principle - this article will give you a simple understanding
Consul installation
Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev
Soem EtherCAT source code analysis I (data type definition)
Drive LED -- GPIO control
C WinForm [change the position of the form after running] - Practical Exercise 4
Process communication mode between different hosts -- socket
Nb-iot technical summary
Altium designer learning (I)
Development tools -- gcc compiler usage
Communication standard -- communication protocol
Adaptive filter