当前位置:网站首页>调用整数或字符数组函数里的参数应该传入啥
调用整数或字符数组函数里的参数应该传入啥
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;
}






边栏推荐
- Force buckle 1331. Array serial number conversion
- Nips18(AD) - 利用几何增广的无监督异常检测《Deep Anomaly Detection Using Geometric Transformations》
- After reading the thesis for three years, I learned to read the abstract today
- Application of time series database in Hydropower Station
- Libgdx learning path 01: libgdx introduction and running tutorial
- BLDC 6步换相 simulink
- When CNN meets transformer cmt:revolutionary neural networks meet vision transformers
- Failed to install app-debug.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
- Mid 2022 summary
- Validate hardware DDR design with Xilinx MIG
猜你喜欢

Cvpr19 - adjust reference dry goods bag of tricks for image classification with revolutionary neural network

力扣 1331. 数组序号转换

使用百度EasyDL实现明厨亮灶厨师帽识别

Share several coding code receiving verification code platforms, which will be updated in February 2022

It is the best tool to evaluate six kinds of map visualization software in three categories

R language text mining and natural language processing tutorial

英文翻译西班牙语-批量英文翻译西班牙工具免费

Transformer for anomaly detection - instra "painting transformer for anomaly detection"

When CNN meets transformer cmt:revolutionary neural networks meet vision transformers

Validate hardware DDR design with Xilinx MIG
随机推荐
Libgdx learning road 02: draw game map with tiled
Accumulation and development -- the way of commercialization of open source companies
R language text mining and natural language processing tutorial
Module 8 of the construction camp
Using Baidu easydl to realize chef hat recognition of bright kitchen and stove
SQL audit tool self introduction owls
JS preventDefault() 键盘输入限制 onmousewheel stopPropagation停止事件传播
Rust 入门指南(modules 和工程结构)
New this prototype precompiled exercise
IMU heating
Force buckle 1331. Array serial number conversion
Tikz draw Gantt chart in FJSP -trans necessary
SaltStack常用的模块
Rust Getting Started Guide (crite Management)
RFs self study notes (II): theoretical measurement model - without clutter but with detection probability
ICLR21(classification) - 未来经典“ViT” 《AN IMAGE IS WORTH 16X16 WORDS》(含代码分析)
一家芯片公司倒在了B轮
Understanding of PID
Adobe XD web design tutorial
Application value of MES production management system to equipment