To add to what the others have said, don't do this:
char* arsFile1Data[iLineTot1];
_st1.arsFileData = arsFile1Data;
Since that code is executed in a function, the array of pointers to your strings is created on the stack, and the space is released and reused immediately your function ends. That's OK - but a bad practice - in the
main
function, but can cause some very odd bugs in other functions which are spectacularly hard to track down. The technical term is a
dangling reference
or
dangling pointer
[
^]
Instead, you need to allocate space on the heap using
malloc
as shown by Richard, and then use
malloc
again to create each individual string:
int iLineTot1 = 2;
_st1.arsFileData = (char**) malloc(iLineTot1 * sizeof(char*));
_st1.arsFileData[0] = (char*) malloc(sizeof(char) * 10);
_st1.arsFileData[1] = (char*) malloc(sizeof(char) * 16);