Add Students
A function made to add students data to database
1. studentInput() function
studentInput() function1.1: Description:
1.2: Syntax:
short form:
void studentInput(student *e); //routine
studentInput(myStudent); // call functionfull form:
void studentInput(student *e) {
char filename[100];
printw("Enter Student id (layout: yyyy[bac_id]): ");
scanw("%llu", &(e->id));
printw("Enter Student's first name : ");
scanw("%s", e->nom);
printw("Enter Student's last name : ");
scanw("%s", e->prenom);
printw("Enter Student's home adress: ");
scanw(" %[^\n]", e->adresse);
CHECKPOINT1:
printw("Enter Student's Email: ");
scanw("%s", e->email);
if(!check(isEmail, e->email)){
printw("\nInvalid email !\n");
goto CHECKPOINT1;
}
CHECKPOINT2:
printw("Enter Student's age: ");
scanw("%d", &(e->age));
if(!check(age, e->age)){
printw("\nInvalid age value !\n");
goto CHECKPOINT2;
}
}1.3: Parameters:
1.4: Input:
1.5: Output:
1.6: Usage:
2. addStudent() function
addStudent() function2.1: Description:
2.2: Syntax:
short form:
full form (definition):
2.3: Input:
2.4: Output:
2.5: Usage:
Last updated