3
I have the following two-dimensional matrix of strings.
char matriz[linhas][tamanhoDaString]
Through the strcpy
I copied a string there.
char *aux = "abc";
strcpy(matriz, aux);
My goal was to put in linha 3
the string aux
.
How can I solve my problem?
Try: strcpy(matrix[2], aux); (whereas the index part of 0 and therefore the third row is matrix[2]).
– user4552
See test at: http://ideone.com/Gk6tdH
– user4552
@Urbester: I suggest you turn on your compiler warnings.
– pmg
I have the warnings on, I am compiling directly on the linux console. I have already solved the problem.
– urb