+ 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; }
4 Answers
+ 4
I hope this code explains this.
https://code.sololearn.com/cYUYNaxBw6Yr/?ref=app
+ 6
Aaron Eberhardt Thanks for explaining so well. đđ»đ
+ 5
I got it. Thanks Martin Taylor đ
+ 4
You can also write your own functions with a variable number of arguments as Aaron Eberhardt demonstrated.