Well i not really sure how to use function so here is my question. I got and array
and i declared it in a function but then my main program got code that required the array from my function but it couldn't detect it and pop up weird number so can help me explain how really function works for array? And what is the differences between void func() and int func() ?
See, if you write a function which will take an array or a variable or anything and then use it then you have to give the arguement in the function defination. For example let there be a function for insertion sort. void InsSort(int AR, int size)
and in the main you input an array of 10 random numbers in array and the size(i.e 10) is stored in n and you want to sort it, then in main call the function in the following way InsSort(array,n)