Preview:
#include <stdio.h>

int main() {
    int num = 42;     // An integer variable
    int *pointer;         // A pointer to an integer

    pointer = &num;       // Store the memory address of 'num' in 'ptr'

    // *ptr = 10;        // Change the value of 'num' to 10 through the pointer

    printf("num: %d\n", *pointer);  // This will output "num: 10"

    return 0;
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter