|
|
#1 |
|
odd warning
Code:
int i, *tension; tension = (int *) calloc(MAX_READINGS, sizeof(int)); if (fscanf(readings,"%s %d\n", reading_times[0], tension[0]) == EOF) Last edited by OllyW; Jan 20, 2013 at 12:29 PM. Reason: fixed code tags |
|
|
|
0
|
|
|
#2 |
|
You didn't tell us what warning you're getting and we don't know anything about your reading_times[] variable.
|
|
|
|
0
|
|
|
#3 |
|
fscanf() requires pointer-to-int for %d. What type is tension[0]?
|
|
|
|
0
|
|
|
#4 |
|
thanks guys.
I found the error while writing the post but couldn't find out how to delete it. I left out the & in front of tension[0]. |
|
|
|
0
|
|
|
#5 |
|
You probably do not want to test against EOF in *scanf functions, they return EOF only under very special circumstances. If you test against != 2, you will catch read errors and all other cases.
|
|
|
|
0
|
|
|
#6 | |
|
Quote:
To avoid having people answer or ask follow-up questions in the interval before the post is deleted, simply replace your entire post with the word "delete". |
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 01:18 AM.







Linear Mode
