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

Function main

Chapter 7/04_pointer_arithmetic.c:3–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <stdio.h>
2
3int main(){
4
5 // POINTER ARITHMETIC USING INTEGER POINTER
6 // int a = 5;
7 // int *ptr = &a;
8 // printf("The address of a is %u\n", &a);
9 // printf("The address of a is %u\n", ptr);
10 // ptr++;
11 // printf("The value of ptr is %u\n", ptr);
12
13 // POINTER ARITHMETIC USING CHARACTER POINTER
14 char a = 'A';
15 char *ptr = &a;
16 printf("The address of a is %u\n", &a);
17 printf("The address of a is %u\n", ptr);
18 ptr++;
19 printf("The value of ptr is %u\n", ptr);
20 return 0;
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected