Relative Content

Tag Archive for arrayscstruct

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]. […]