0
#include <stdio.h>
#include <conio.h>

struct student where I declare the types of data related

struct student {
    int id;
    int year_career;
    char group;
};
student e; // <- error: unknown type name 'student'

Function enter:

void enter (student* e) {
    printf("Enter the id");
    scanf("%d",&e.id);
    printf("Enter the year of the race");
    scanf("%d",&e.year);
    printf("Enter the group");
    scanf("%c",&e.group);
}

Dispaly funcion

void display (student alum) {
    printf("The id is");
    printf("%d",e.id);
    printf("\r\n");
    printf("The year of the race is");
    printf("%d",e.year_career);
    printf("\r\n");
    printf("The group is");
    printf("%c",e.group);
    printf("\r\n");
}

Principal function

int main() {
    enter(&e);
    display(e);
    getch();
    return 0;
}

Run the following error:

error: unknown type name 'student'

Alejandro Caro
  • 998
  • 1
  • 10
  • 22
  • 4
    In C, but not C++, you have to use `struct student` (unless you write `typedef struct student student;`). – Jonathan Leffler Sep 02 '17 at 21:10
  • You might want to take a couple of steps back, [get a couple of good beginners books](http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list), and start reading about structures (and types in general) again. – Some programmer dude Sep 02 '17 at 21:11

0 Answers0