Array manipulation or what Should I say this I donno | Sololearn: Learn to code for FREE!

+5

Array manipulation or what Should I say this I donno

https://www.sololearn.com/post/492836/?ref=app How it is 35...Can anyone pleaee explain

c++ c

8/14/2020 10:07:01 AM

Gorom_Pani

13 Answers

New Answer

+9

There is nothing related to array manipulation. The function "fun()" is just displaying the first argument that it receives. In first case it is 3 And in other it is 5

+4

They are just to signify that function defination is complete. Nothing related to programming, it's just that the one who wrote the question want you to only focus on the first parameter and others are irrelevant.

+4

AteFish🇧🇩 you are right but you are not passing an array here, you are just passing a lot of individual arguments to a function.

+3

Arsenic I know arrays are like pointers and as the print only s that means they printed the first element. Am I right?

+2

The first one returns 3 and the second one returns 5. Without the std::endl it looks like 35 but it isn't. They are 2 different numbers.

+2

Arsenic I wanna know why the three dots(...) are here?

+2

Bartas Dausynas Pass the last named argument to va_start (here b) and first argument (numbers) needs to be 3, instead of 5

+1

I think they are indicating that any number of arguments can be passed in the function.

+1

Bartas Dausynas Code works fine, have already fixed it? Ok do you mean variadic list after some number of fixed element?