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 बनाम union: union में सभी fields एक ही memory साझा करते हैं। C interviews में यह सवाल अपेक्षित है।