sara v's Profile

About

 
Points: 10

Pages

Contact

 

sara v  >>  Bucky Roberts
June 2, 2015 · Public

sara v ยท 5 minutes ago
i have a project that consist of a student database. it includes saving students name, their characteristics, marks, subjects etc.. BUT I HAVE A PROBLEM.... when i save the subjects, its ok... but after i close it and open it, they dont show again (arent saved).... and when i have to modify a mark in a subject, all of the marks of all of the subjects of a specific student change (and the value of the variable isnt saved but their address is)....

ITS URGENT!!! MY DEADLINE IN FRIDAY!!!

the link is: http://paste.ofcode.org/8udDbWAZRRi5fyQc2F2Zhk

sara v
May 31, 2015 · Public

Hey everybody!
Need some help with an issue I'm having with my code (student database)
I'm having some trouble modifying student's record and I don't understand why. Could you please have a look?
void Modifikim() //void function added to the main one
{
int select3;
char choice3;
int isFound = 0;
char IDno;
char s_id[15];
while(select3!=2){
system("cls");
printf("\n\t\t ======================================");
printf("\n\t\t | MENU: |");
printf("\n\t\t | |");
printf("\n\t\t | [1] Modify sudent's mark |");
printf("\n\t\t | [2] Back to the main menu |");
printf("\n\t\t ======================================");
printf("\n\t\t\tSelect: ");
scanf("%d", &select3);


switch(select3){
case 1:
{
system("cls");
printf("\n\t\t\t\t-MODIFY STUDENT'S MARKS-");
printf("Enter ID to Modify: ");
fflush(stdin);
gets(s_id);
fp = fopen("studentfile.txt","rb+");
while(fread(&stu, sizeof(stu),1,fp) == 1){
if(strcmp(s_id, stu.ID_no) == 0){
fflush(stdin);

for(int i=0;i

Buckys Fans
388 Followers