Hi, I'm making a program that's meant to take 20 names from a user, sort them into alphabetical order using selection sorting, and output the names in order. I decided to make the problem a little simpler by using numbers first instead. So it takes twenty numbers from the user, puts them in order, and then outputs the numbers in the correct order. (You get the idea)
However, I'm running into problems. I fixed the program in Visual Studio to the point that all my errors went away, but now I'm getting new errors saying:
"1>c:\users\spenser\documents\visual studio 2005\projects\sortnames\sortnames\sorting.cpp(54) : error C2556: 'void Swap(int [],int,int)' : overloaded function differs only by return type from 'int Swap(int [],int,int)'
1> c:\users\spenser\documents\visual studio 2005\projects\sortnames\sortnames\sorting.cpp(7) : see declaration of 'Swap'
1>c:\users\spenser\documents\visual studio 2005\projects\sortnames\sortnames\sorting.cpp(54) : error C2371: 'Swap' : redefinition; different basic types
1> c:\users\spenser\documents\visual studio 2005\projects\sortnames\sortnames\sorting.cpp(7) : see declaration of 'Swap'"
I've attached the source code for viewing. I can't see any problems, but obviously something is wrong.
Scratch that. I just noticed I had function Swap as an int, and then a void later. So yeah. . Now I just need help with my problems switching it over to names.
Last edited by duskrue; March 28th, 2008 at 06:47 PM.
I altered the code to take names instead, and I'm not getting any errors with that. The problem that the compiler obviously won't pick up is that when it does out put the names, they aren't in order.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.