Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Structs in C are easy! ๐Ÿ“ฆ
Play lesson

C tutorial for beginners โš™๏ธ - Structs in C are easy! ๐Ÿ“ฆ

4.0 (0)
13 learners

What you'll learn

This course includes

  • 6.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#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"); }

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere