Question Details

No question body available.

Tags

c++

Answers (11)

February 23, 2026 Score: 3 Rep: 2,254 Quality: Low Completeness: 40%

what kind of help do you require? ... it helps a lot if you ask a question ... how would you respond if someone said to you I need to build a race car, it should be red. Please help

February 23, 2026 Score: 2 Rep: 34,238 Quality: Medium Completeness: 80%

You're going to find that a ridiculous number of programming problems can be solved by you simply doing what you would do with a pencil, some paper, and someone shouting inputs at you. Usually you can improve upon that simple "What would human do?" algorithm after the fact once you see the patterns involved in the process. The kicker is do something that works so that you A) have something to hand in and B) have a baseline you can use to compare future improvements against.

Snide answer: if you cant use the sort function, use the qsort function.

But seriously, Sorting algorithms are very well covered on the Internet. Here's a Wiki page with a list of the suckers. Most, if not all (didn't check all of them), of the articles for the linked algorithms contain pseudo codes you can use to get started, and, if you are careful, get finished. If you get stuck in the middle, that's when you should consider asking a question. Ask too soon and you'll get generic answers like this one because you don't really have a programming question yet.

February 23, 2026 Score: 2 Rep: 58,151 Quality: Low Completeness: 0%

My fingers are starting to finger.

February 23, 2026 Score: 1 Rep: 8,038 Quality: Low Completeness: 0%

How would you sort by hand if you weren't programming? Now how would you translate those steps into programming? Does your textbook say anything about sort algorithms?

February 23, 2026 Score: 1 Rep: 58,151 Quality: Low Completeness: 0%

FYI, we don't do homework here. There are other places on the internet where you can get your answers.

February 23, 2026 Score: 1 Rep: 5,278 Quality: Low Completeness: 0%

The assignment requirements don't even specify a sorting algorithm to use?

February 23, 2026 Score: 0 Rep: 35,525 Quality: Medium Completeness: 80%

I need to make a function that sorts an array without using the sort function.

There are literally thousands, if not millions of examples on the internet that shows how to sort using various algorithms using C++.

Here is one link here on StackOverflow:

How to implement classic sorting algorithms using modern C++.

If you "need to make a function", I suggest you read carefully about the various sorting algorithms, then try to understand the code at the link as to how the code implements the algorithm.

Once you do that, then it is simple to test one of those functions at the link. You simply add the proper #include files

#include 
#include 

and then call your function, delegating it to the sort function you chose:

For example:

void sort (int array[], int n)
{
   return selection_sort(array, array + n);
}

int main() { int arr[] = {4,1,9,10,100,5}; sort(arr, 6); }

Warning: If this is homework, the teacher will either know you duplicated the code at the link, or if not, will probably ask you to explain your answer. In other words, don't blindly copy and paste code from the Internet, ChatGPT, or even StackOverflow without understanding what the code is doing.

February 23, 2026 Score: 0 Rep: 58,151 Quality: Low Completeness: 0%

You could cheat by searching the internet for "C++ sorting algorithms" and see what comes up.

In the professional world, much knowledge is gained by searching first.

February 23, 2026 Score: 0 Rep: 1 Quality: Low Completeness: 0%

Thanks, my brain is starting to brain

February 23, 2026 Score: 0 Rep: 5,530 Quality: Low Completeness: 30%

Why can't you use the sort function?

For sorting things, it's the right tool for the job. And it's built right into C++.

February 23, 2026 Score: 0 Rep: 611,256 Quality: Low Completeness: 30%