Hi Geeks,
i have declare Char *a type variable and i want to fill data in a[0][n], a[1][n], ... a[max][n]. below is my code snippet which i'm facing build error while initializing.
I'm getting build error as ".....subscript requires array or pointer type "
.........
char *a;
a = (char*)calloc(3,sizeof(int)+3);//trying to allocate for these a[0][5], a[1][5], a[2][5]
for (int i = 0;i<3;i++)
for (int j = 0; j<5;j++)
a[i][j] = 1;
..........
--
Thanks in advance.
Perry31 -6 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.