I have no idea what the heck I'm doing. This isn't homework by the way, I'm doing this to study ahead of class. Basically I have to make it so that this program can take a user-inputted set of numbers and put them in ascending order. I did it before w/out functions but there's something up with how my functions are set up, any and all help is appreciated.
Ok I fixed that (thanks, can't believe I didn't notice that).
I'm getting these errors:
2 IntelliSense: argument of type "double *" is incompatible with parameter of type "double ** 990
Error 1 error C2664: 'void showArrPtr(double *[],int)' : cannot convert argument 1 from 'double *' to 'double *[]' 990 1
void showArrPtr(double *[],int), the double *[] is effectively a pointer to a point to a double.
In showArray(donations, NUM_DONATIONS); donations is a pointer to a double, so you need to take the address of donations (put a & in front of it, read it as take the address of the variable) showArray(&donations, NUM_DONATIONS);
God, thanks a lot! I think I need to go re-study this chapter cause I really don't get this. I just have one last problem, not an error, but the "original order" is showing up as addresses, not values. How can I fix this/What's the issue?
One thing to remember is that void Foo(int []); is the same as void Foo(int *);.
So void Foo(int *bar[]) is the same as void Foo(int **bar). Here you have two levels of indirection, so you would need two levels of dereferencing to get to the value, something like **(bar + index) or *bar[index].
Sorry if this doesn't make much sense, I've been up 20hrs on 4hrs sleep.