Program Console Vignaankosh.com
Execution Panel
Console is empty.
Constant structure (const) is an interactive C dry run visualizer from the Structures 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>
typedef struct {
char name[30];
int version;
float threshold;
} Config;
void displayConfig(const Config *cfg) {
// cfg->version = 10; // ERROR: can't modify const parameter
printf("Config: %s v%d (threshold: %.2f)\n",
cfg->name, cfg->version, cfg->threshold);
}
int main() {
// Constant structure - CANNOT be modified after initialization
const Config defaultSettings = {"System Default", 1, 75.5};
// defaultSettings.version = 2; // ERROR: can't modify const struct
// Regular structure - can be modified
Config userSettings = {"User Profile", 1, 80.0};
userSettings.version = 2; // OK - not const
printf("Default (const): ");
displayConfig(&defaultSettings);
printf("User (mutable): ");
displayConfig(&userSettings);
return 0;
}