Tsallaka zuwa abun ciki
Justice Tech School

Pointers

A pointer stores an address. & gets an address and * reads or writes through it.

Example
#include <stdio.h>

int main(void) {
  int x = 10;
  int *p = &x;
  *p = 20;
  printf("%d %d %d\n", x, *p, p == &x);
  return 0;
}

Result

20 20 1

Exercise

Address of.

int *p = x;

Quiz Test

What does *p do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.