当前位置:网站首页>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;
}
}
边栏推荐
- CAM Pytorch
- . Net starts again happy 20th birthday
- WCF: expose unset read-only DataMember property- WCF: Exposing readonly DataMember properties without set?
- [illumination du destin - 38]: Ghost Valley - chapitre 5 Flying clamp - one of the Warnings: There is a kind of killing called "hold Kill"
- Numpy library introductory tutorial: basic knowledge summary
- pytorch fine-tuning (funtune) : 镂空设计or 偷梁换柱
- Vulnstack3
- Timescaledb 2.5.2 release, time series database based on PostgreSQL
- Unified blog writing environment
- Traditional chips and AI chips
猜你喜欢
Application and Optimization Practice of redis in vivo push platform
[OpenGL learning notes 8] texture
Logstash、Fluentd、Fluent Bit、Vector? How to choose the appropriate open source log collector
Official announcement! The third cloud native programming challenge is officially launched!
MATLB | multi micro grid and distributed energy trading
Introduce reflow & repaint, and how to optimize it?
Codeforces Global Round 19 ABC
Practice of tdengine in TCL air conditioning energy management platform
"2022" is a must know web security interview question for job hopping
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
随机推荐
"2022" is a must know web security interview question for job hopping
Timescaledb 2.5.2 release, time series database based on PostgreSQL
Prometheus monitors the correct posture of redis cluster
MySQL backup and recovery + experiment
线上故障突突突?如何紧急诊断、排查与恢复
Pytorch register_ Hook (operate on gradient grad)
Go RPC call
PHP Joseph Ring problem
He was laid off.. 39 year old Ali P9, saved 150million
Advanced conditional statements of common SQL operations
增量备份 ?db full
Valentine's Day flirting with girls to force a small way, one can learn
Express routing, express middleware, using express write interface
PHP wechat official account development
Vulnstack3
Using druid to connect to MySQL database reports the wrong type
Huawei machine test question: longest continuous subsequence
Chinese natural language processing, medical, legal and other public data sets, sorting and sharing
Binary tree traversal - middle order traversal (golang)
85.4% mIOU! NVIDIA: using multi-scale attention for semantic segmentation, the code is open source!