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:-/
addicted
0
Junior Poster in Training
Recommended Answers
Jump to PostIt depends on the function you're calling. It could be defined as
void foo(T* someArray, int arraySize, int otherValue)
or asvoid foo(T* someArray, int otherValue, int arraySize)
. The second one sucks, but you'll just have to check.
All 2 Replies
Reply to this topic
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.