当前位置:网站首页>Start the remedial work. Print the contents of the array using the pointer
Start the remedial work. Print the contents of the array using the pointer
2022-07-05 02:06:00 【Xiao Sun's code sharing】
Write a function to print arr Contents of array , Do not use array subscripts , Use the pointer .
arr Is an integer one-dimensional array .
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int arr[] = {1,2,3,4,5,6,7,8,9};
int* p = arr;// Defining pointer variables
int len = sizeof(arr) / sizeof(arr[0]);// Calculate the length of the array
for (int i = 0; i <len; i++)
{
printf("%d\n", *p);
++p;
}
}
边栏推荐
- Can financial products be redeemed in advance?
- Stored procedure and stored function in Oracle
- Lsblk command - check the disk of the system. I don't often use this command, but it's still very easy to use. Onion duck, like, collect, pay attention, wait for your arrival!
- Win:使用 PowerShell 检查无线信号的强弱
- STM32 series - serial port UART software pin internal pull-up or external resistance pull-up - cause problem search
- MATLB|多微电网及分布式能源交易
- Numpy library introductory tutorial: basic knowledge summary
- Summary and practice of knowledge map construction technology
- PowerShell:在代理服务器后面使用 PowerShell
- Three properties that a good homomorphic encryption should satisfy
猜你喜欢
phpstrom设置函数注释说明
[OpenGL learning notes 8] texture
Icu4c 70 source code download and compilation (win10, vs2022)
Three properties that a good homomorphic encryption should satisfy
Practice of tdengine in TCL air conditioning energy management platform
Traditional chips and AI chips
Main window in QT application
R language uses logistic regression and afrima, ARIMA time series models to predict world population
"2022" is a must know web security interview question for job hopping
Introduce reflow & repaint, and how to optimize it?
随机推荐
MySQL backup and recovery + experiment
如何搭建一支搞垮公司的技术团队?
One plus six brushes into Kali nethunter
PHP 基础篇 - PHP 中 DES 加解密详解
MATLB|多微电网及分布式能源交易
[understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
STL container
Introduce reflow & repaint, and how to optimize it?
runc hang 导致 Kubernetes 节点 NotReady
Tucson will lose more than $400million in the next year
85.4% mIOU! NVIDIA: using multi-scale attention for semantic segmentation, the code is open source!
Visual explanation of Newton iteration method
官宣!第三届云原生编程挑战赛正式启动!
Practice of tdengine in TCL air conditioning energy management platform
R language uses logistic regression and afrima, ARIMA time series models to predict world population
Application and Optimization Practice of redis in vivo push platform
Huawei machine test question: longest continuous subsequence
PowerShell: use PowerShell behind the proxy server
Process scheduling and termination
The MySQL team development specifications used by various factories are too detailed. It is recommended to collect them!