![]() |
gets() produces garbage [would appreciate some more help]
This compiles, but it only produces garbage
any ideas? :
#include <stdio.h>I'm trying to read this robotfile.txt into a 2-dimensional array Quote:
|
Two quick things i noticed...
1) you are using fgets on a file pointer opened with the "w" flag, this should be "r". 2) getvals doesn't take an argument... |
That did it, thanks!
|
I fixed the file pointers and the function calls and prototypes but I am still having problems.
I think the problem is with reading the file into a two-dimensional array, or printing the array out, I'm not sure which. I don't think it is the size of my arrays (I have tried both 20 and 21 to account for the eos char), but I think it may have something to do with the relationship between functions, arrays, and pointers... see above for an example of what the program is reading in :
#include <stdio.h> |
| All times are GMT -5. The time now is 7:44 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC