I guess what you want is:
Remember when you have a 2D array, such as str above, str[i] points to the 1D array contained at line i, which is a string.
/* ... read str */
for(i = 0;i < length;i++)
Regarding the assignment NO IT IS NOT CORRECT. You have to copy the contents of one string into another using strcpy(char destination, char source);
strcpy is a function in string.h . You should look it up.
So you would do something like :
int store_string(char temp, char function)
int j, i, n, r=0;
char temp = "hello";
strcpy(function[r], temp); /*store string into row 0 */
r++; /*incrementing the row cause i want to store the next string in the next row*/