can anyone help me out with this . ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
11th Dec 2018, 4:49 AM
Muneer
Muneer - avatar
5 Answers
+ 5
For your second problem: When I close the program and logged in again the information of user reservation deletes. I want to save the user's reservation information too. In registration(): log = fopen("login.txt", "ab"); // must be opened as binary so I added 'b' there ~~~~~~~ In login(): struct login l[100]; // should be a buffer big enough to hold maximum registered users log = fopen("login.txt", "rb"); // binary reading ... for (int i = 0; i < 100; ++i) { fread(&l[i], sizeof(struct login), 1, log); if (strcmp(username, l[i].username) == 0 && strcmp(password, l[i].password) == 0) { system("CLS"); printf("\nYou are successfully logged in !!\n"); fclose(log); menu(); } } system("CLS"); fclose(log); login(); ~~~~~~ Note: By doing the above fixes I can't see any issue with your first problem. Now, you can insert more info to the end of the file. If there's something missing or wrong tell me.
11th Dec 2018, 9:18 AM
Babak
Babak - avatar
+ 1
have mentioned someone who can help with the code.... have tried debugging... but it seems am having problem because am checking it out on my phone.....
11th Dec 2018, 8:41 AM
✳AsterisK✳
✳AsterisK✳ - avatar
0
John Wells should be able to help.... i try finding the bug, now am getting headache... i could also learn from this
11th Dec 2018, 8:33 AM
✳AsterisK✳
✳AsterisK✳ - avatar
0
what should i do ? i want to make it work but i dont know how
11th Dec 2018, 8:39 AM
Muneer
Muneer - avatar
0
thankyou i am waiting for someone to answer 😭😭
11th Dec 2018, 8:42 AM
Muneer
Muneer - avatar