For example:
Code:
# include <stdio.h>
# include <conio.h>
# include <string.h>
struct RecordInfo {
char Student_Name[25];
int id_num[10];
int Tel_Num[7]; // no "." in variable names!
char Address[40];
char Program[15];
};
int main () {
struct RecordInfo test;
return 0;
}
You can compile and run this code. It does not do anything, of course, but at least you now know it has no syntax errors. (You may get a warning for an "unused" variable).
Vis, a date of birth is almost certainly a string, so fgets() is good:
Code:
char buffer[1024];
printf("Enter date of birth: ");
fgets(buffer,1024,stdin);
fprintf(stderr, "->%s<-",buffer);
There's four lines you can add and test. The fprintf line is just for debugging. You can //comment them out. fprintf(stderr...) ensures it will be output immediately (printf is buffered) which is better for debugging.
You'll notice:
->dateofbirth
<-
because the input has a newline in it. If that's a problem, your next little task is how to get rid of the newline.