This commit is contained in:
2023-09-23 22:20:41 +03:00
parent 609aa52e66
commit 66997adad5
42 changed files with 642 additions and 0 deletions

23
learnc/learnc10.c Executable file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
typedef struct {
char * name;
int age;
} person;
/* function declaration */
void birthday(person * p) {
p->age++;
}
int main() {
person john;
john.name = "John";
john.age = 27;
printf("%s is %d years old.\n", john.name, john.age);
birthday(&john);
printf("Happy birthday! %s is now %d years old.\n", john.name, john.age);
return 0;
}