Program Console Vignaankosh.com
Execution Panel
Console is empty.
Modify structure using pointer is an interactive C dry run visualizer from the Struct Functions Pointers 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.
#include <stdio.h>
#include <string.h>
struct Laptop {
char brand[50];
int ram; // in GB
int storage; // in GB
};
int main() {
struct Laptop myLaptop = {"Dell", 8, 512};
struct Laptop *ptr = &myLaptop;
printf("Before Modification:\n");
printf("Brand: %s, RAM: %dGB, Storage: %dGB\n",
ptr->brand, ptr->ram, ptr->storage);
// Modify using pointer
strcpy(ptr->brand, "HP");
ptr->ram = 16;
ptr->storage = 1024;
printf("\nAfter Modification:\n");
printf("Brand: %s, RAM: %dGB, Storage: %dGB\n",
ptr->brand, ptr->ram, ptr->storage);
return 0;
}