当前位置:网站首页>3、 Are formal and actual parameters in a programming language variables?
3、 Are formal and actual parameters in a programming language variables?
2022-07-28 20:05:00 【A programmer who loves playing badminton】
problem 1: What are formal and actual parameters ?
Formal parameters are when we define functions , Parameters written in parentheses
The argument is when we call the function , Incoming parameter
The number of formal and actual parameters must be the same , The positions should correspond one by one , Data types should be compatible
problem 2: Are formal parameters and arguments a variable ?
No , Formal and actual parameters are never a variable
Let's verify whether the arguments and formal parameters are variables
#include <iostream>
#include <stdio.h>
using namespace std;
void test(int i)
{
i = 99;
printf(" Shape parameter i The address for :%#X\n", &i);
}
int main(int argc, char const *argv[])
{
int i = 6;
printf(" Actual parameters i The address for %#X\n", &i);
test(i);
printf(" after test Function to get i by %d\n", i);
return 0;
}
i By function test after ,i The value of has not changed , And the shape parameter i And real parameters i The address of is different , This further illustrates that arguments and formal parameters are not variables .
边栏推荐
- English translation Italian - batch English translation Italian tools free of charge
- Return and job management of saltstack
- Codeignier framework implements restful API interface programming
- Tencent cloud deployment lamp_ Experience of building a station
- How many types of rain do you know?
- editor.md中markdown编辑器的实现
- KPMG China: insights into information technology audit projects of securities fund management institutions
- zfoo增加类似于mydog的路由
- In the second half of 2022, the system integration project management engineer certification starts on August 20
- There is a 'single quotation mark' problem in the string when Oracle inserts data
猜你喜欢
利用STM32的HAL库驱动1.54寸 TFT屏(240*240 ST7789V)
Rand function generates pseudo-random numbers
The results of the second quarter online moving people selection of "China Internet · moving 2022" were announced
[C language] initial C language reflection and summary
Thoroughly understand bit operations - shift left, shift right
[NPP installation plug-in]
Handan, Hebei: expand grassroots employment space and help college graduates obtain employment
[C language] simulation implementation of pow function (recursion)
Cloud computing notes part.2 - Application Management
Integration and implementation of login click graphic verification code in personal blog system
随机推荐
[C language] print pattern summary
Android section 13 03xutils detailed explanation of database framework (addition, deletion and modification)
Codeignier framework implements restful API interface programming
【NPP安装插件】
How many types of rain do you know?
Application skills of programming rising and falling edge instructions of botu 1200/1500plc (bool array)
Handan, Hebei: expand grassroots employment space and help college graduates obtain employment
Stories of Party members | Li qingai uses cartoons to drive farmers to increase income and become rich
Can China make a breakthrough in the future development of the meta universe and occupy the highland?
Special draft of Mir | common sense knowledge and reasoning: representation, acquisition and application (deadline on October 31)
认识中小型局域网WLAN
Redis notes
MySQL8 tmp_ table_ Size and Max_ heap_ table_ size
Sequential linear table - practice in class
Digital filter design matlab
11. Learn MySQL union operator
Servlet学习笔记
The results of the second quarter online moving people selection of "China Internet · moving 2022" were announced
Common APIs in string
[网络]跨区域网络的通信学习IPv4地址的分类和计算