CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Mar 2008
    Posts
    6

    selection sorting

    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.
    Attached Files Attached Files
    Last edited by duskrue; March 28th, 2008 at 06:47 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured