Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
#include
// Define a struct struct Car { char brand[50]; int year; }; int main() { struct Car car = {"Toyota", 2020}; // Declare a pointer to the struct struct Car *ptr = &car; // Access members using the -> operator printf("Brand: %s\n", ptr->brand); printf("Year: %d\n", ptr->year); return 0; }
Brand: Toyota
Year: 2020