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

Function main

Chapter 7/06_array_using_pointers.c:3–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <stdio.h>
2
3int main(){
4 int marks[] = {12, 34, 53, 66};
5
6 int* ptr = &marks[0];
7 // int* ptr = marks; // Same as int* ptr = &marks[0];
8
9 for (int i = 0; i < 4; i++)
10 {
11 // printf("The marks at index %d is %d\n", i, marks[i]);
12 printf("The marks at index %d is %d\n", i, *ptr);
13 ptr++;
14 }
15
16
17
18
19 return 0;
20}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected