0

hey,
i just read about passing arrays to functions in C++ like this
function modifyArray(arrayname, arraysize); i need help with sending an array and another variable to a function... since the array size is an integer and the second integer is also going to be in the argument... i dont know which variable will follow the array name.. is it the array size or the second variable i am willing to pass to the fuction as well:-O:-/

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by addicted
0

It depends on the function you're calling. It could be defined as void foo(T* someArray, int arraySize, int otherValue) or as void foo(T* someArray, int otherValue, int arraySize) . The second one sucks, but you'll just have to check.

0

the fuction i am calling is to search an array for a number, the number i am to search for is to be passed as an arguement

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.