the bubble problem help

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
using namespace 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 ==========
Look at line 4
how to fix?
Make the prototype and the definition match.
Topic archived. No new replies allowed.