Hi everyone. I am having a simple, noob problem with parameter passing.
Say I have
I try to pass something like this to my functionCode:int j[]={4, 2, 3, 5,6}
When I go into the function with the array j and check the size, it comes out to size 1 as if only passing the first value!Code:void randomSort(int arr[]){ ....... } int main(){ randomSort(j); }
I am checking the size value withIs there something wrong with my parameter type? or is it something else? Thanks!Code:int arraysize = sizeof(array)/sizeof(*array);
EDIT: found that my way of computing arraysize = sizeof(array)/sizeof(*array) is wrong, continuing to work on the sort (which I found after looking on the internet).