#include <iostream>
usingnamespace std;
void sort(int array, int length);
int main()
{
int a[]={7,9,5,6,3,5};
int i;
sort(a,6);
for(i=0;i<=6;i++)
cout<<a[i];
return 0;
};
void sort(int*array,int length)
{
int i,j;
for(i=0; i<length; i++)
{
for(j=0;j<i;j++)
{
int temp;
if(array[i]<array[j])
{ array[i]=temp;
array[j]=array[i];
temp=array[j];
}
}
}
}
//the compiler shows that:1>------ Build started: Project: the bubble function, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\danny\documents\visual studio 2010\projects\the bubble function\the bubble function\main.cpp(10): error C2664: 'sort' : cannot convert parameter 1 from 'int [6]' to 'int'
1> There is no context in which this conversion is possible
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========