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 RepliesReply to this topic
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.