repl.it
@m_s__santos/

operations-with-pointers

C

No description

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
#include "stdio.h"

int main(void) {
  int nums[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  
  int *p1 = &nums[2], *p2 = &nums[3];
  
  printf("%d\n", (int) *p2 - *p1);
  printf("%d\n", (int) *p2 + *p1);
  
  return 0;
}