I've been working with my lab for days and can't figure it out. I know there are people who's smart enough to figure out just for minutes which I'm spending days. My problem is that I can't sort in ascending order, descending order, with printArray function which I commented out. Can anyone one explain me please? Thanks in advance!
First, your printArray prototype in line 46 declares const *ptr.
But then , in line 251 you try to modify a const which is not allowed.
You can fix this by removing const in the prototype and subsequent function definitions.
Also, in line 247 you compare an address and an integer which is also not allowed.
remove the & from (&ptr[loc] < ptr[smallIndx] .
Also, you selection sort does not belong to any function. Maybe u intended to make it part of the printArray function. Afther all, i put it in printArray when i was testing it.
Finally, i dont know if you intended to print memory locations along the numbers. line 226 .
Fix this and your program should work just fine.
Besides, they were just compiler errors. No big deal.