Difference ???

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
void change (char Tab[][100], int I, int J)
{
    char Aux[100];
    
    Aux=Tab[I];
    Tab[I]=Tab[J];
    Tab[J]=Aux;
    
}

void change(char ptr[][100], int pos1, int pos2)
{
	char aux[100];
    
	strcpy(aux,ptr[pos1]);
	strcpy(ptr[pos1],ptr[pos2]);
	strcpy(ptr[pos2],aux);
    
}


Somebody tell me what's the difference ?
First one will not work in some many cases.
First one will never work.
The first function is invalid and will not be compiled. You may not use the name of an array in the left side of the assignment operator
Arrays have no the assignment operator. They can be only copied.
Topic archived. No new replies allowed.