It keeps telling me that there are build errors even though I am certain that there is no problem in my code:
#include <stdio.h>
#include <string.h>
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_DEPRECATE
typedef struct
{
char name[50];
char ID[10];
int age;
int grades[5];
}Student;
int main()
{
Student student1;
strcpy(student1.name, "Abood");
strcpy(student1.ID, "1034913");
student1.age = 15;
student1.grades[0] = 2;
student1.grades[1] = 32;
student1.grades[2] = 424;
student1.grades[3] = 43;
student1.grades[4] = 5;
for (int i = 0; i < 5; i++) printf("grade[%d] = %d", i, student1.grades[i]);
return 0;
}
I tried basically everything. I also face the same problem with scanf if I don’t use
#define _CRT_SECURE_NO_WARNINGS although I wasn’t facing that problem before, and I didn’t need to include that preprocessor directive.
New contributor
Friendo 65l3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4