I am trying to compile bubble sort program and i get a error message back. "In function ... too many arguments to function. What does this mean?
can you give me the soultion
...
#include<iostre am>
using namespace std;
void swap ( int A[]);
int main()
{
int n,i,j;
int A[4];
int temp;
cout<<"please,e nter size of element in array";
cin>>n;
cout<<"please,e nter numbers of elements in array";
cin>>A[i];
for(i=n-1;i>=1;i--)
{
for(j=0;j<=i-1;j++)
{
if(A[j]>A[j+1])
swap(A,j);
{
temp=A[j];
A[j]=A[j+1];
A[j+1]=temp;
}
}
}
cout<<"element befor sorte are:";
{
else
cout<<"element after sort are:";
system("pause") ;
}
can you give me the soultion
...
#include<iostre am>
using namespace std;
void swap ( int A[]);
int main()
{
int n,i,j;
int A[4];
int temp;
cout<<"please,e nter size of element in array";
cin>>n;
cout<<"please,e nter numbers of elements in array";
cin>>A[i];
for(i=n-1;i>=1;i--)
{
for(j=0;j<=i-1;j++)
{
if(A[j]>A[j+1])
swap(A,j);
{
temp=A[j];
A[j]=A[j+1];
A[j+1]=temp;
}
}
}
cout<<"element befor sorte are:";
{
else
cout<<"element after sort are:";
system("pause") ;
}
Comment