I tried to scan 2 different strings to 2 different elements of the same struct and I don't know why its not working.
This is my code:
struct qRegStudents{
char studID[6];
char studName[25];
};
typedef struct qRegStudents students;
int RegStudent() {
students Student;
char temp[6];
printf("Enter ID Number: ");
scanf(" %6s",Student.studID);
printf("Enter Name: ");
scanf(" %25s",Student.studName);
printf("%s",Student.studID);
return 0;
}
I input the student ID as "123456" and then the name as "josh". It prints "123456josh" as just the student ID