BubbleSort

Pages: 123
Yes
What is the meaning difference between snap and swap?

"Yes" does not answer this question. This is a Wh- question.
I think your teacher meant "swap".
Swap is the when you swap the numbers but snap is the bubble sort
Have you written your function main?
Your function said "void swap()"??
I thought that was it .
Have you written your function main?
what is that ??
You don't even know the function main()?
nevermind ! i know what you talking about . Just forget it becuase Im not going to get it right . So it dont even matter
So what is your next problem?
Thats what I trying to figure what i need to do and where to begin
And your original assignment? The more detailed the better.
Thats the original assignmenet
That's the original assignmenet

Your assignment is to write a function main()?
The original function is to a function that performs a snap for the numbers array
1
2
3
4
5
6
7
8
9
void swap(int &x, int &y, int t = 0) {t = x, x = y, y = t;}

void bubbleSort(int arr[], int size)
{
    int i, j;
    for(i = 0; i < size; i++) 
    for(j = 0; j < size - 1; j++) 
    if(arr[j] > arr[j+1]) swap(arr[j], arr[j+1]);
}
The original function is to a function that performs a snap for the numbers array

Presumably, you mean the original function is a function that performs a swap for the numbers array. Such a function is convenient to have in order to facilitate the creation of a sorting function (such as one that implements the bubblesort algorithm.)

Boxbird is right in that the original function is broken. I would verify that you've reproduced it correctly (because I'm fairly certain you have not.)

I was going on what my teacher gaves us . He was like put in Visual Studio and it should run but I was thinking something isnt right and it is missing some things
Pages: 123