You should not use strcpy() on anything that isn't STRINGS. If you want to use a library function to copy generic data, then you should use memcpy().
Edit: And of course, with code like this:
even if we replace strcpy with something that copies the array properly, it will just copy garbage, since array and copy contain nothing useful until you have filled them in with something meaningful. So you are just copying random gunk, really [and you're just lucky that the program doesn't crash at that point - obviously there is a zero somewhere in the data before you've done too much damage by using strcpy to copy something that isn't a string].Code:int array[ SIZE ]; /* declare the array of ints to be sorted (test with bublesort)*/ int copy[SIZE];/*copy of original array to test with selectionsort*/ strcpy(array ,copy );
--
Mats