Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 typedef struct { int a; int b; } AStruct; // Case 1: an actual instance AStruct MyAStruct; // If you want to access member a or b, you use . MyAStruct.a = 1; MyAStruct.b = 2; // Case 2: a pointer AStruct * MyAStrucyPointer; MyAStructPointer = &MyAStruct; // In this case, if you want to access the members through the pointer: MyAStructPointer->a = 1; MyAStructPointer->b = 2;
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 typedef struct { int a; char b; } STRUCT1, *PSTRUCT1; STRUCT1 s[10]; PSTRUCT1 ps; int i; int x; int y; for (i=0, ps = s;i<10;i++,ps++) { x = ps->a; y = s[i].a; }
Not afraid - I want to be familiar with more ways to do the same thing so I recognize when I see them...By the way, why are you afraid of -> ?
Please post an example.If you want to do it without the -> operator, just take the actual instantiation of your structure / object.