当前位置:网站首页>调用整数或字符数组函数里的参数应该传入啥
调用整数或字符数组函数里的参数应该传入啥
2022-07-28 17:39:00 【9677】
- 先说结论
//经过实验数组,不管是字符数组还是数组
//在调用的时候,都是要传入数组地址的
//调用的函数参数可以为 int A ,int A[ ]
//int A[ ]这是因为数组名为数组首地址
//指针类型为int,指针指的是地址
//同时你向函数传入可以写fun(A)
//或fun(&A[1])这里传的是 第二个数组元素的地址
//字符数组同理,下面为运行例子 - 下面是各代码运行结果
#include"stdio.h"
void fun(int A[]){
for(int i=0;i<3;i++)
printf("%d\n",A[i]);
}
int main(){
int A[3]={
1,2,3};
fun(&A[1]);
return 0;
}






边栏推荐
- Application of time series database in monitoring operation and maintenance platform
- 企业级分布式爬虫框架入门
- BLDC 6-step commutation simulink
- SaltStack系统初始化
- 【笔记】《结网:互联网产品经理改变世界》
- 使用SaltStack自动化部署LNMP
- After reading the thesis for three years, I learned to read the abstract today
- 我的第二次博客——C语言
- 微信公众号授权登录后报redirect_uri参数错误的问题
- SaltStack之return与job管理
猜你喜欢

Understanding of PID

智能合约安全——溢出漏洞

source insight项目导入和使用教程

Srs4.0 installation steps

Nips18 (AD) - unsupervised anomaly detection using geometric transformations using geometric augmentation

SQL审核工具自荐Owls

adb remount of the / superblock failed: Permission denied

在矩池云快速安装torch-sparse、torch-geometric等包

Swing事件处理的过程是怎样的?

Kotlin Android development novice tutorial
随机推荐
Solve the critical path in FJSP - with Matlab source code
ES6's new data container map
From Bayesian filter to Kalman filter (2)
SaltStack之salt-ssh
ES6 conversion of new data type set and arr set map
English article translation - English article translation software - free batch translation
SQL审核工具自荐Owls
Iclr21 (classification) - future classic "vit" an image is worth 16x16 words (including code analysis)
Sword finger offer II 109. unlock the password lock
Self-adaptive multi-objective evolutionary algorithm for flexible job shop scheduling with fuzzy pro
RFs self study notes (4): actual measurement model - the mixture of OK and CK, and then calculate the likelihood probability
Doxygen document generation tool
Application of time series database in bridge monitoring field
Libgdx learning path 01: libgdx introduction and running tutorial
SQL audit tool self introduction owls
Photoshop responsive web design tutorial
智能合约安全——溢出漏洞
Asp net MVC web development tutorial
[notes] Networking: Internet product managers change the world
【笔记】《启示录》:产品经理的实践经验与反省清单