Program Console Vignaankosh.com
Execution Panel
Console is empty.
Pointer to array of structures 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>
struct Movie {
char title[50];
int year;
float rating;
};
int main() {
struct Movie movies[3] = {
{"Inception", 2010, 8.8},
{"Interstellar", 2014, 8.6},
{"The Dark Knight", 2008, 9.0}
};
struct Movie *ptr = movies; // Points to first movie
printf("Using pointer to access array:\n");
for(int i = 0; i < 3; i++) {
printf("Movie %d: %s (%d) - Rating: %.1f\n",
i+1, (ptr+i)->title, (ptr+i)->year, (ptr+i)->rating);
}
printf("\nUsing array indexing:\n");
for(int i = 0; i < 3; i++) {
printf("Movie %d: %s (%d) - Rating: %.1f\n",
i+1, movies[i].title, movies[i].year, movies[i].rating);
}
return 0;
}