how i can use loop to traverse array if i dnt knw the size?
I was participating in a programming contest in which i only have to write function and function declaration was given as int med(int intput1[],int intput2[])
Or declare a global variable called size and set it to the size of the array and use that inside of the function so it does not modify the argument list.
i don't know that if array passed is declared as global or in void main as i can't see the void main() and ican't take chance as only 1 attempt is left
how i can use loop to traverse array if i dnt knw the size?
...
i cant change the argument list,it is already define
You can't. It's 100% impossible (at least not without doing extremely nasty, compiler-dependent tricks).
Unless the size is stored globally somewhere there is no way to know the array size from just those parameters.
EDIT: I find it hard to believe that the contest is giving out impossible problems. Maybe you are misinterpretting the problem? Can you give a link to the contest?
Tech Challenge would like to access your public profile, friend list, email address, work history, education history, hometown, current city and your friends' work histories, education histories, hometowns and current cities.
I always hit cancel.
Anyway, it's a coding challenge. If you can't even repeat the instructions intelligibly, maybe the challenge isn't for you.