how pointers work in c code example
Example 1: poiner in c
#include <stdio.h>
int main() {
int c = 5;
int *p = &c;
printf("%d", *p); // 5
return 0;
}
Example 2: poiner in c
int* pc, c, d;
c = 5;
d = -15;
pc = &c; printf("%d", *pc); // Output: 5
pc = &d; printf("%d", *pc); // Ouptut: -15
Example 3: How to use pointers in C
myvar = 25;
foo = &myvar;
bar = myvar;