Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

matrix of string in c

#define ROW 3
#define COL 3
int main(int argc, char *argv[])
{
    int i, j;
    char *matrix[ROW][COL] = {
        {"aa", "bb", "cc"},
        {"dd", "ee", "ff"},
        {"gg", "hh", "ii"},
    };

    for(i = 0; i < ROW; i++){
        for(j = 0; j < COL; j++){
            printf("matrix[%d][%d] is %s
", i, j, matrix[i][j]);
        }
    }

    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #matrix #string
ADD COMMENT
Topic
Name
3+6 =