Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filing

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
how we can store the record of the students on the strorage
by using the filing of c
please send me a one example by using structure
 
Just and example, if I understand your question correctly...

typdef struct student_t {
char fname[FNAMESIZE];
char lname[LNAMESIZE];
char student_id[SIDSIZE];
} Student;

main()
{
Student st;
int st_file;
...
... get the data into the structure
...

st_file = open(...);
write(st_file, (void *)&st, sizeof(Student));
...
...
return(0);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top