请教高手这道小小的题目错在哪里
失败是妈妈 2004-11-22 01:19:11 #include<iostream.h>
void swap(int* a,int* b)
{
int ptr[5];
int temp;
b=ptr[5];
a=ptr[5];
for (*a=0;*a<=10;*a++)
{
for(*b=0;*b<=10;*b++)
{
if(*a>*b)
cout<<*a<<*b;
if(*a<*b)
temp=*a;
*a=*b;
*b=temp;
}
}
void main()
{
int ptr[5]={1,3,2,5,4};
swap(&a,&b);
cout<<*a<<*b;
return 0;
}