Hi
I need to get this short c-code working for a colleague. He has compiled it to work on his mac. You can see the source at http://www.physionet.org/physiotools/dfa/dfa.c and you can read about the program at http://www.physionet.org/physiotools/dfa/dfa-1.htm
I know virtually nothing about c and would appreciate some guidance.
I have replaced the code that reads the command line arguments with printf & scanf instructions to prompt for inputs and this works fine.
Then we come to the difficult bit: We want to read in a list of data from a text file. Currently it uses the 'standard input' which I think means the keyboard. The program keeps looping around accepting values, but we can't seem to terminate the list input. This is the line in question: while (scanf("%lf", &y) == 1) { ...
Can someone please point me in the right direction? Initially to get the keyboard input working, and possibly to read a file instead?
Many thanks in advance.
Tony.
I need to get this short c-code working for a colleague. He has compiled it to work on his mac. You can see the source at http://www.physionet.org/physiotools/dfa/dfa.c and you can read about the program at http://www.physionet.org/physiotools/dfa/dfa-1.htm
I know virtually nothing about c and would appreciate some guidance.
I have replaced the code that reads the command line arguments with printf & scanf instructions to prompt for inputs and this works fine.
Then we come to the difficult bit: We want to read in a list of data from a text file. Currently it uses the 'standard input' which I think means the keyboard. The program keeps looping around accepting values, but we can't seem to terminate the list input. This is the line in question: while (scanf("%lf", &y) == 1) { ...
Can someone please point me in the right direction? Initially to get the keyboard input working, and possibly to read a file instead?
Many thanks in advance.
Tony.
Comment