当前位置:网站首页>function overloading
function overloading
2022-07-03 16:39:00 【Steal ice cream in the middle of the night】
function overloading
Use The same Function name as Function as Function name of the function of .
for example : Compare the size function of numbers ——— Function name ( fun )
Compare the size of the number
doubt : 1. The type of number ( int / float / double)
2. Number of numbers ( 2 individual 3 individual ……)
These questions distinguish functions The key is :
1. The type of the argument to the function ( It needs to be considered Assignment compatibility The situation of )
2. The number of arguments to the function
Be careful : Maybe someone will question , Why can't the return value of a function be the key to distinguishing functions ?
The compiler depends on the type and number of arguments in the call time statement , Determine the specific function version of the call , Compile phase , The program has not been executed , So I don't know what the return value is , More uncertain about the type .
Be careful : When the parameter is reference
The situation is special when the parameter is reference
a key : Compile time Sure distinguish
void fun(int a,int b) and void fun(double &a,double &b)
Compile time You can't distinguish
void fun(int a,int b) and void fun(int &a,int &b)
Be careful : Is there a problem when the parameter is a pointer, like when the parameter is a reference ?
answer : no !
边栏推荐
- Explore Netease's large-scale automated testing solutions see here see here
- Simulink oscilloscope data is imported into Matlab and drawn
- Register in PHP_ Globals parameter settings
- How to initialize views when loading through storyboards- How is view initialized when loaded via a storyboard?
- Overview of satellite navigation system
- 架构实战营 - 第 6 期 毕业总结
- 线程池执行定时任务
- NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
- Alibaba P8 painstakingly sorted it out. Summary of APP UI automated testing ideas. Check it out
- 为抵制 7-Zip,列出 “三宗罪” ?网友:“第3个才是重点吧?”
猜你喜欢

Détails du contrôle de la congestion TCP | 3. Espace de conception
![[solved] access denied for user 'root' @ 'localhost' (using password: yes)](/img/71/1ff8ed1d773da99054310f96dca3f8.jpg)
[solved] access denied for user 'root' @ 'localhost' (using password: yes)

拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。

Thread pool executes scheduled tasks

Mysql 将逗号隔开的属性字段数据由列转行

消息队列消息丢失和消息重复发送的处理策略

NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
![[combinatorics] polynomial theorem (polynomial theorem | polynomial theorem proof | polynomial theorem inference 1 item number is the number of non negative integer solutions | polynomial theorem infe](/img/9d/6118b699c0d90810638f9b08d4f80a.jpg)
[combinatorics] polynomial theorem (polynomial theorem | polynomial theorem proof | polynomial theorem inference 1 item number is the number of non negative integer solutions | polynomial theorem infe

MySQL converts comma separated attribute field data from column to row

What is the pledge pool and how to pledge?
随机推荐
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (4)
Mysql 单表字段重复数据取最新一条sql语句
Aike AI frontier promotion (7.3)
Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
QT串口ui设计和解决显示中文乱码
IDEA-配置插件
Caching mechanism of Hibernate / session level caching mechanism
Data driving of appium framework for mobile terminal automated testing
什么是质押池,如何进行质押呢?
Idea configuration plug-in
斑馬識別成狗,AI犯錯的原因被斯坦福找到了
How programming apes grow rapidly
Unreal_ Datatable implements ID self increment and sets rowname
Eleven requirements for test management post
Unreal_DataTable 实现Id自增与设置RowName
Golang 装饰器模式以及在NSQ中的使用
Client does not support authentication protocol requested by server; consider upgrading MySQL client
SVN使用规范
程序猿如何快速成长
Construction practice camp - graduation summary of phase 6