Hey, I have a doubt. What is three dots (...) in the function's parameter? Someone please tell me! I will be so grateful. 🙌🏻🥺 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Hey, I have a doubt. What is three dots (...) in the function's parameter? Someone please tell me! I will be so grateful. 🙌🏻🥺

for example: int average(int num1, ...) { //Code } int main() { average(1, 2, 3, 4, 5); return 0; }

22nd Jan 2021, 4:37 PM
Mahima Rajvir Singh
Mahima Rajvir Singh - avatar
4 Answers
+ 4
I hope this code explains this. https://code.sololearn.com/cYUYNaxBw6Yr/?ref=app
22nd Jan 2021, 4:46 PM
Aaron Eberhardt
Aaron Eberhardt - avatar
+ 6
Aaron Eberhardt Thanks for explaining so well. 🙌🏻🌟
22nd Jan 2021, 4:55 PM
Mahima Rajvir Singh
Mahima Rajvir Singh - avatar
+ 5
I got it. Thanks Martin Taylor 👍
22nd Jan 2021, 5:09 PM
Mahima Rajvir Singh
Mahima Rajvir Singh - avatar
+ 4
You can also write your own functions with a variable number of arguments as Aaron Eberhardt demonstrated.
23rd Jan 2021, 8:09 PM
Sonic
Sonic - avatar