Lesson 22 of 23
Structures (struct)
11 min 35 XP
struct വ്യത്യസ്ത types-ലുള്ള fields ഒരു പുതിയ type ആയി കൂട്ടുന്നു, വിദ്യാർത്ഥിയുടെ പേര്, roll number, മാർക്ക് എന്നിവ പോലെ. typedef അതിന് ചെറിയ പേര് നൽകുന്നു, -> pointer വഴി field-ൽ എത്തുന്നു.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.struct vs union: union-ൽ എല്ലാ fields-ഉം ഒരേ memory പങ്കിടുന്നു. C interviews-ൽ ഈ ചോദ്യം പ്രതീക്ഷിക്കൂ.