> Please help me with this C++ friend function bubble sort program!! URGENT!?

Please help me with this C++ friend function bubble sort program!! URGENT!?

Posted at: 2014-12-18 
Two separate issues here, friend functions and bubblesorting.

To understand friend functions you first have to understand classes. In C++ and other languages a class is the combination of a data structure with functions which operate on that data. Some of the data may be private and inaccessible to the rest of the program. A friend function, though not belonging to the class, can nevertheless get at the data from outside. For how to declare friend functions, look at this site:

http://msdn.microsoft.com/en-us/library/...

Bubble sorting is one of the many ways of sorting a list of data and putting them into order. You start with an array or list and compare the first element with the second. If the first is bigger than the second, you exchange them and set a marker variable to true to show that an exchange has happened on that run through. Then you consider the second and third elements and do the same. When you get to the end of the array and the marker is set, you reset the marker to false and go through it all again from the beginning. Once you have got to the end of the array without the marker being set, then you have completed the sort.

The bubble sort code obviously goes in the friend function and operates on a private array in your C++ class. Good luck.

Write a program in c++ to bubble sort a list of array elements implementing the concept of friend function which will contain the body of bubble sort code!!!!

I'm totally new to c++ so having quite a lot of problems... PLEASE HELP!!