ointers

C Pointers

C Pointers

A pointer is a variable that stores the memory address of another variable.

Declaring and Using Pointers

#include 

int main() {
    int number = 10;
    int *ptr = &number;  // Pointer to the address of number

    printf("Value of number: %d\n", number);
    printf("Address of number: %p\n", &number);
    printf("Value of ptr: %p\n", ptr);
    printf("Value pointed to by ptr: %d\n", *ptr);
    return 0;
}
    

This program demonstrates the use of pointers by storing and accessing the address of a variable and dereferencing it.