I have an issue with my code, I can fill the table but when I display it, it display 0
for me, here is my code
#include<iostream>
#include<vector>
using namespace std;
int n;
void lire_tab(vector<int> A);
void tri_tab(vector<int> A);
void aff_tab(vector<int> A);
int main()
{
cout<<"donnez la taille du tableau: ";
cin>>n;
vector<int> A(n);
lire_tab(A);
aff_tab (A);
tri_tab (A);
aff_tab (A);
return 0;
}
void lire_tab(vector<int> A)
{
for(int i=0;i<n;i++)
{
cout<<"A["<<i<<"]= ";
cin>>A[i];
}
cout<<"________________________"<<endl;
}
void tri_tab(vector<int> A)
{
int temp;
temp=0;
for(int i=0; i<n; i++)
{
for(int j=0; j<n; j++){
if(A[i]<A[j])
{
temp = A[i];
A[i] = A[j];
A[j] = temp;
}
}
}
}
Can you help me please, I'm really lost in this, I don't really figure out why it print 0