

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Structs
incomplete
2: Initializers
incomplete
3: Scaling Coordinate
incomplete
4: Typedef
incomplete
5: Sizeof
incomplete
6: Struct Padding
incomplete
This lesson's interactive features are locked, please to keep using them
Remember how we can not return multiple values from a function in C? We can't do this:
int, char * become_older(int age, char *name) {
return age + 1, name;
}
However, we can accomplish effectively the same thing by returning a struct:
struct Human become_older(int age, char *name) {
struct Human h = {.age = age, .name = name};
h.age++;
return h;
}