MIPI_AdvancedC_FRTK/Lect1/23_page_36-38.c

30 lines
545 B
C
Raw Normal View History

2024-11-14 08:45:50 +03:00
#include <stdio.h>
struct student
{
int id;
char name[20];
int group;
};
void func(struct student record)
{
printf(" Id is: %d \n", record.id);
printf(" Name is: %s \n", record.name);
printf(" Group is: %d \n", record.group);
}
void pfunc(struct student *record)
{
printf("Id is: %d \n", record->id);
printf("Name is: %s \n", record->name);
printf("Group is: %d \n", record->group);
}
int main(void) {
struct student record = {1, "Vasiliy", 102};
func(record);
pfunc(&record);
return 0;
}