C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include<stdlib.h>
struct stock{
char cat[20];
int row;
int col;
char **item;
}st;
int main() {
int i,j,row,col;
printf ("enter the number of row\n");
scanf("%d",&st.row);
printf("enter the number of column\n");
scanf ("%d",&st.col);
st.item=(char *)malloc(st.row*st.col*sizeof(st.item));
for(i=0;i<st.row;i++)
{
for(j=0;j<st.col;j++){
st.item[i][j]=(struct node*)malloc(st.item);
scanf ("%s",st.item[i][j]);
}
}
for(i=0;i<row;i++)
{
for(j=0;j<col;j++){
printf("%s",st.item[i][j]);
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run