tags:

views:

248

answers:

2
char myData[505][3][50];   //2D array, each 50 chars long   
char **tableData[505] = {NULL};  

const char* text;
text = sqlite3_column_text(stmt, col_index);

strcpy(myData[row_index][c_index],text); 

tableData[row_index] = myData[row_index][c_index]; <--?

I would like to assign the pointer to pointer array tableData to the content of the static array myData but do not know the syntax, or if it possible. Any advice?

+1  A: 

What tableData is going to represent?

If it's going to represent an array of strings (I'll call a char* a string for simplicity in this answer), you should edit the declaration to char* tableData[len];.

If it's going to represent a 2D array of strings (which is what the current declaration means), you should set it as tableData[i] = myData[x].

myData[x][y] is a single string, not an array of strings. In the last line of your snippet, you are trying to assign it to something that expects an array of strings. This is not a valid operation.

Mehrdad Afshari
+2  A: 

Just

tableData[row_index] = myData[row_index]
Danra