Structs in C are easy! 📦
Bro Code
@brocodezAbout
Coding bootcamps HATE HIM! 🗿
Latest Posts
Video Description
#coding #programming #cprogramming typedef struct{ char name[50]; int age; float gpa; bool isFullTime; }Student; void printStudent(Student student); int main() { Student student1 = {"Spongebob", 30, 2.5, true}; Student student2 = {"Patrick", 36, 1.0, false}; Student student3 = {"Squidward", 48, 3.2, false}; Student student4 = {0}; strcpy(student4.name, "Sandy"); student4.age = 27; student4.gpa = 4.0; student4.isFullTime = true; printStudent(student1); printStudent(student2); printStudent(student3); printStudent(student4); return 0; } void printStudent(Student student){ printf("Name: %s\n", student.name); printf("Age: %d\n", student.age); printf("GPA: %.2f\n", student.gpa); printf("Full-time: %s\n", (student.isFullTime) ? "Yes" : "No"); printf("\n"); }
You May Also Like
Essential Coding Tools
AI-recommended products based on this video

New Slim 65W USB C Laptop Charger for Lenovo ThinkPad Yoga 7i 7 9i 9 2-in-1 Yoga Book 9i Gen 10 ThinkBook 16 15 14 Gen 8/7 13s 13x 14s IdeaPad Slim/Pro 5X 5i 5 3X 3i 3 2-in-1 Type C Power Cord

135W USB C AC Adapter Charger for Lenovo ThinkPad Z16 P16s P15s P14s E16 E15 E14 T16 Yoga/Slim Pro 9 7 6 7i 9i Book 9 ThinkBook 16 14p 14 15 14s IdeaPad Slim/Pro 9 7 5 Legion 9 Laptop ADL135YSDC3A

140W C to Magnetic 3 Charger, Compatible with MacBook Air 13, 15 Inch/Mac Book Pro 14, 16 Inch, M1/M2/M3/M4 from 2021/2022/2023/2024/2025 Models, 6.6FT【Original Quality】

MSI MAG MT201D - Premium Heavy Duty Dual Monitor Stand Arms, 17-45" Support, VESA Compatible, Adjustable Spring Mount, 44 lbs per Screen, Clamp & Grommet, Quick Release Plate - Black

Mind Reader Monitor Stand, Height Adjustable, Ventilated Laptop Riser, Office, Metal, 36.8L x 23.5W x 14H cm, Black

Seventable L Shaped Computer Desk with Drawers 47.2 inch,Gaming Desk with Power Outlets & LED Lights,Reversible Office Desk with Storage Shelves,Corner Desk with Monitor Stand for Home Office White




















