Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7570177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:21:23+00:00 2026-05-30T15:21:23+00:00

I am currently trying to write a program that alphabetizes strings. I have one

  • 0

I am currently trying to write a program that alphabetizes strings. I have one error. It’s that minLocation does not take 2 arguments. I am fairly new to programming could anyone give me a hint as to why this part of my code is wrong?

int minLocation(string list[], int first, int last)
{
  int mIndex=first;
  int loc = 0;

    for (loc = first+1; loc <= last; loc++)
        if (list[loc] < list [mIndex])
            mIndex = loc;
    return mIndex;

void Sort(string slist[],int length)
{
   int mIndex;

       for (int loc = 0; loc < length-1; loc++)
       {
           mIndex = minLocation (loc,length-1);
           swap (loc, minIndex);
       }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:21:24+00:00Added an answer on May 30, 2026 at 3:21 pm

    Without seeing the definition of minLocation, we can’t tell. But it’s a safe bet that it doesn’t take two arguments – compilers don’t lie to you just for the fun of it, you can usually assume that what they’re saying is true 🙂

    You need to find the definition, something like:

    int minLocation (int loc) { ...
    

    and figure out how you’re actually meant to call it. Given that it looks like it’s trying to find which of two indexes has the lower value, it may be that it needs more than two arguments.

    And, on top of that, you need to decide whether you want that variable called mIndex or minIndex. Most compilers aren’t quite smart enough to figure that out for you.

    Based on your edits that muinFunction is defined as:

    int minLocation (string list[], int first, int last) { ...
    

    it seems evident that it also needs the string array as well as the two indexes. You will need to change the call to:

    mIndex = minLocation (slist, loc, length-1);
    

    And keep an eye on the swap call as well. It may have a similar requirement, based on the coding style.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to write a program that solves the rsa challenge (yes i have
I am currently trying to write an addin for PowerPoint that whenever any PowerPoint
I'm currently trying to write a voicechat program in python. All tips/trick is welcome
I am currently trying to write a very simple app that sends an object
I'm trying to write a program to automate one of my more boring and
Currently, I have a program that reads a file and uses an XMLTextWriter to
I am trying to write a program that scan an ip range and detect
I'm trying to write a simple program that will compare the files in separate
I'm trying to write a program with C# that sends text into other windows.
The idea of my simple program that I've been trying to write is to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.