Structs in C are easy! 📦 @BroCodez
Structs in C are easy! 📦  @BroCodez
Uploaded April 2025 | Updated September 2026, 1 week ago
#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");
}
Structs in C are easy! 📦How to READ FILES with Java in 8 minutes! 📖Read files using C programming in 6 minutes! 📖Learn VARIABLE SCOPE in 4 minutes! 🏠Learn NumPy data types in 8 minutes! 💱Return statements in C are easy! 🔙Learn octal in 113₈ secondsMatplotlib customization is easy! 🎨Learn Java METHOD OVERRIDING in 4 minutes! ♻️Code a Java temperature converter in 7 minutes! 🌡️Learn BREAK & CONTINUE in 2 minutes! 🚦Learn OVERLOADED CONSTRUCTORS in 6 minutes! 🛠️
Bro Code |

Structs in C are easy! 📦

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER