I need to store strings in 2D array and output the array. I can find the strings but i'm confused on how to store them into the array. Here is the function i have so far:
Is that correct?Code:int store_string(char temp[10], char function[10][10]) { int j, i, n, r=0; char temp[] = "hello"; function[r][10] = temp; /*store string into row 0 */ r++; /*incrementing the row cause i want to store the next string in the next row*/ }
and also, how would i output the 2D array? is it like this?
or neither?Code:printf("%s" , function); or printf("%s", function [10][10]);



LinkBack URL
About LinkBacks


