int main(int argc, char * argv[]) { Student s1; strcpy(s1.name, "Amy Smith"); s1.year = 3; s1.GPA = 3.6; changeStudent(& s1); printf("===main===\n"); printStudent(s1); return EXIT_SUCCESS; }
void hello() { int done =1; while (done) { system("cls"); HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; int i; char str[100]; pos.X = 30; pos.Y = 10; SetConsoleCursorPosition(handle, pos); printf("Commands: "); pos.X = 30; pos.Y = 11; SetConsoleCursorPosition(handle, pos); printf("1. Take a look at list of students (list)"); pos.X = 30; pos.Y = 12; SetConsoleCursorPosition(handle, pos); printf("2. Change student (change)"); pos.X = 30; pos.Y = 13; SetConsoleCursorPosition(handle, pos); printf("3. Add new student (add)"); pos.X = 30; pos.Y = 14; SetConsoleCursorPosition(handle, pos); printf("Exit(exit)"); editPlace(); gets(str); if (strcmp(str, "list")==0) { showList(); } else if (strcmp(str, "change")==0) { changeStudent(); } else if (strcmp(str, "add")==0) { createStudent(); } else if (strcmp(str, "exit")==0) { done = 0; } else { system("cls"); pos.X = 30; pos.Y = 10; SetConsoleCursorPosition(handle, pos); printf("Wrong command"); pos.X = 1; pos.Y = 20; SetConsoleCursorPosition(handle, pos); system("pause"); } } }