Pointer to different data types (int, char, float) Dry Run in C

Pointer to different data types (int, char, float) is an interactive C dry run visualizer from the Pointersintro programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Pointer to different data types (int, char, float) Program Code

#include <stdio.h>
int main() {
    int i = 42;
    float f = 3.14;
    char c = 'A';
    
    int *iptr = &i;
    float *fptr = &f;
    char *cptr = &c;
    
    printf("Integer: value=%d, address=%p, size=%lu\n", *iptr, iptr, sizeof(iptr));
    printf("Float: value=%.2f, address=%p, size=%lu\n", *fptr, fptr, sizeof(fptr));
    printf("Char: value=%c, address=%p, size=%lu\n", *cptr, cptr, sizeof(cptr));
    
    // Pointer arithmetic difference
    printf("\nPointer arithmetic (adding 1):\n");
    printf("int* + 1 = %p (adds %d bytes)\n", iptr+1, sizeof(int));
    printf("float* + 1 = %p (adds %d bytes)\n", fptr+1, sizeof(float));
    printf("char* + 1 = %p (adds %d bytes)\n", cptr+1, sizeof(char));
    
    return 0;
}

View the complete Pointersintro programs page.

Program Console Pointer to different data types (int, char, float) Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.