当前位置:网站首页>Pointer array function combination in C language
Pointer array function combination in C language
2022-06-25 05:14:00 【Distant Aoki】
#include<stdio.h>
void initarray(int *array,int size)
{
int i;
for(i=0;i<size;i++)
{
printf(" Please enter the first %d Data :\n",i+1);
scanf("%d",array); // Or it can be written as scanf("%d",array++);
array++;
}
}
void printarray(int *array,int size)
{
int i;
for(i=0;i<size;i++)
{
printf("%d\n",*array);// Or it can be written as scanf("%d",*array++);
array++;
}
}
int main()
{
int array[5];
int size=sizeof(array)/sizeof(array[0]);
initarray(array,size);// The actual parameter is the first address of the array , The array name represents the address of the first element
printarray(&array[0],size);
return 0;
}
/* Mixed writing of pointer and array name :
1、 Pointer as array name , Subscript access
2、 Add... To the array name
3、 You can't array++,sizeof Time pointer variables occupy eight bytes
/* for example
int main()
{
int array[3]={1,2,3};
int *p=array;
for(i=0;i<3;i++)
{
printf("%d",p[i]);1、 Pointer as array name , Subscript access
}
for(i=0;i<3;i++)
{
printf("%d",*(array+i));1、 Array name plus
}
}
边栏推荐
- Page electronic clock (use js to dynamically obtain time display)
- ORA-00800: soft external error
- API interface management setup -eolinker4.0
- Cookie & session & JSP (XII)
- XSS (cross site script attack) summary (II)
- Summary of SQL injection (I)
- A brief talk on media inquiry
- CUDA compilation error
- How to install the blue lake plug-in to support Photoshop CC 2017
- Eyeshot 2022 Released
猜你喜欢

Read the general components of antd source code

Dynamic programming example 2 leetcode62 unique paths

Reading and writing of nodejs excel (.Xlsx) files

CSRF (Cross Site Request Forgery) &ssrf (server request forgery) (IV)
![H5 canvas drawing circle drawing fillet [detailed explanation]](/img/6f/a33a323b6cd0918066e8b71a22d841.jpg)
H5 canvas drawing circle drawing fillet [detailed explanation]

Everything is an object

February 20ctf record

Activereportsjs V3.0 comes on stage

EL & JSTL (XIII)

great! Auto like, I use pyautogui!
随机推荐
Jason learning
Understand JS high-order function and write a high-order function
Laravel Vonage SMS sending
Notes on non replacement elements in the line (padding, margin, and border)
IronOCR 2022.1 Crack
Google Earth Engine(GEE)——全球JRC/GSW1_1/YearlyHistory数据集的批量下载(中国区域)
Opensea PHP development kit
Google Earth engine (GEE) - Global jrc/gsw1_ 1 / batch download of yearlyhistory dataset (China region)
Could not find “store“ in the context of “Connect(homePage)
Dynamic programming example 2 leetcode62 unique paths
Startup mode of SoC verification environment
Baidu ueeditor set toolbar initial value
[image fusion] image fusion based on MATLAB directional discrete cosine transform and principal component analysis [including Matlab source code 1907]
Critical dependency: require function is used in a way in which dependencies
[keil] GPIO output macro definition of aducm4050 official library
Vue uses keep alive to cache page optimization projects
Customize the console plot result style
Get to know the drawing component of flutter - custompaint
Why does the SQL statement hit the index faster than it does not?
Student achievement management system based on SSH