I would like to pass both array and vector parameters in this function .
i.e. vector<string> &li
How could I adjust it? Thanks!
1 2 3 4 5 6 7
|
void sort(int i,vector<string> &li){
//sort alphabetically
for(int y=0;y<i-1;y++){
for(int j=y+1;j<i;j++)
if (li[y]>li[j]) swap(li[y],li[j]);
}
}
|
Last edited on