Even better, operator precedence (though it's a moot point since sizeof(char) is 1 anyway).


str[i] = malloc( (strlen(temp)+1) * sizeof(char));


> strncpy(str[i], temp, 10);
You should just...