How many arguments can a return statement have
Is this possible
return(n-1,m+1)

in this case what will it return and why

Recommended Answers

All 4 Replies

But in case you don't have a book...

return can only be passed one value. However it could be an array if they are of the same type.

>>But in case you don't have a book...
Buy, Beg, Borrow or Steal one.

But in case you don't have a book...

return can only be passed one value. However it could be an array if they are of the same type.

That depends on what sort of "array". A locally declared array, such as int ret_arr[10]; cannot be the return value, nor can a C-style string. On the other hand, C++ strings or STL containers (vectors, for example) can be returned.
Val

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.