why can init array in struct with array-name in C
Bellow code is for ‘init array element in strcut’
Why can’t I point to an array in an array?
struct page { int a; int b; }; page chp1p1 = { 1, 2 }; // chapter 1 page 1 page chp1[12] = { chp1p1 }; page chapters[14] = { chp1 }; int main(){ page& currChp = chapters[0]; page& currPart = currChp[0]; printf(“If we are here then no errors”); return 0; } Error at currChp[0]. […]
( C programming ) Why can’t I point to an array in an array?
struct page { int a; int b; }; page chp1p1 = { 1, 2 }; // chapter 1 page 1 page chp1[12] = { chp1p1 }; page chapters[14] = { chp1 }; int main(){ page& currChp = chapters[0]; page& currPart = currChp[0]; printf(“If we are here then no errors”); return 0; } Error at currChp[0]. […]
Accessing a struct array with identical code changes output – C
Background