Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Practice programs on pointers, pointer arithmetic, and pointers with arrays in C.
#include <stdio.h> int main() { int x = 42; int *p = &x; printf("Value : %d\n", *p); printf("Address : %p\n", (void *)p); return 0; }
#include <stdio.h> void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int a = 5, b = 10; swap(&a, &b); printf("a = %d, b = %d\n", a, b); return 0; }
#include <stdio.h> int main() { int arr[] = {1, 2, 3, 4, 5}; int *p = arr; int sum = 0, n = 5; for (int i = 0; i < n; i++) sum += *(p + i); printf("Sum = %d\n", sum); return 0; }