Hi Geeks, i have declare Char *a type variable and i want to fill data in a[n], a[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, a, a for (int i = 0;i<3;i++) for (int j = 0; j<5;j++) a[i][j] = 1; .......... -- Thanks in advance.
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.