Well, first thank you both for advice. Second i tried what thmm wrote but i'am getting same result, a the moment i write name and press Enter cmd gives me back this
Code:
(process 15916) exited with code -1073741819.
Press any key to close this window . . .
current code:
Code:
#include <iostream>
#define NAME_LEN 100
void add_student() {
char first_name[NAME_LEN];
char last_name[NAME_LEN];
float grade_test;
float grade_excercise;
char grade_final[5];
printf("First name: ");
scanf_s("%99s", first_name);
printf("Last name: ");
scanf_s("%99s", last_name);
printf("Grade-test: ");
scanf_s("%f", &grade_test);
printf("Grade-excercise: ");
scanf_s("%f", &grade_excercise);
printf("Grade-test: ");
scanf_s("%c", &grade_final);
FILE* ptr;
fopen_s(&ptr,"index.txt", "w");
fprintf(ptr, "[%s,%s,%f,%f]\n",first_name,last_name,grade_test,grade_excercise);
fclose(ptr);
}