duskrue
March 28th, 2008, 06:42 PM
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.
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.