MCPcopy Create free account
hub / github.com/CodeWithHarry/The-Ultimate-C-Programming-Course / main

Function main

Chapter 9/04_pointer_to_struct.c:10–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8}; // semicolon is important
9
10int main()
11{
12 struct employee e1;
13 e1.code = 56;
14 struct employee *ptr;
15 ptr = &e1;
16 // now we can print structure elements using:
17 // printf("%d", (*ptr).code);
18 printf("%d", ptr->code); // Exactly same as (*ptr).code
19
20 return 0;
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected