The output of the code is this:
John Doe
1111
98 87 69 97 89
85 91 88
It doesn't loop the second time, weird.
Type: Posts; User: phil1p
The output of the code is this:
John Doe
1111
98 87 69 97 89
85 91 88
It doesn't loop the second time, weird.
This is the latest of my code editted. I just paste the fgets and sscanf part so it will be easier for you guys to examine it:
while( fgets ( buf, MAX_STUDENTS, datain ) != NULL ) {
...
Thank you for your help. Now I have a question: If I have an input data which looks like this:
John Doe
1111
98 87 69 97 89
85 91 88
Bill Doe
2222
77 78 87 79 85
I am currently trying on this code, and I want the output to be the same as the input, but my code fails to do that. Please help me out.
/*
* A sample program to read-from and write-to...
After I carefully editted and examined my code, I still have some warning and error in my code such as:
grades.c:12:19: conio.h: No such file or directory
grades.c: In function `main':...
I put the structure in test.h which code is being posted below. I put .c for the file. I'll try to fix the problem u said, filker0.
#define NAME_LEN 30
#define NUM_HW 5
#define NUM_EXM 3...
I run it with my compiler and the code crashed without any error. Anything wrong with this code? Please help me out. Thank you guys.
/*
* A sample program to read-from and write-to files....
THanks everyone for your help! I finally finish the code. What I do is just by adding this code (while (getchar() != '\n');) after the last scanf. Thank you again for your contribution guys, I...
This is not a problem. The problem is in the looping part, I can't figure out what's wrong and the code doesn't give me any error to debug when I compile and run it...
The problem of this code is that when i try to compile and run it, the second looping for the 'gets' is not working and the code jumps to 'scanf' for inputting age and so on. Why is it happenning?
So there is no way using 'gets' to access structures? The lecture told me to use scanf for one code and 'gets' for another code. I have been searching sites by sites for an answer, :(
Can anyone help me with this one please? I really need the answer because I've tried so many ways on doing it but it does not work. Thank you very much for your help.
My question is that I need to know how to use gets in this code, because I am told to use it by my lecture...
This is a cut from my code:
##########################################
/* Database (name,age,salary,height,weight) program using structure and
gets. */
#include <stdio.h>
#include...