Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct {
- int year;/* 学年 */
- int clas;/* クラス */
- int number;/* 出席番号 */
- char *name;/* 名前 */
- } student;
- void student_print(student *data) {
- printf("year: %d\n", data->year);
- printf("clas: %d\n", data->clas);
- printf("number: %d\n", data->number);
- printf("name: %s\n", data->name);
- return;
- }
- int main(void) {
- student *data = (student *) malloc(sizeof(student));
- data->year = 2013;
- data->clas = 1;
- data->number = 1;
- data->name = "Name1";
- student_print(data);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement