Hi Daniel,
Get a good book on C or C++ programming, and learn to use the debugger
and step through your programs and take a close look at what is
happening!
On Thu, 27 Mar 2003, Daniel Fone wrote:
[...]
> if(myfile = NULL)
if(myfile == NULL)
While it is technically possible (and also quite useful) to do
assignments inside the argument of a conditional operator, you
probably mean to check whether there is a file ...
[...]
> char * sQuote;
Now, this will lead to trouble: you have defined a pointer to char,
but you have not allocated any memory for storing a certain number of
chars. That means you can happily set your pointer somewhere, as long
as you do not try to store any chars.
If you use this one
char sQuote[256];
you will also have a pointer to char, but at the same time the space
is allocated.
> fgets(sQuote, 256, myfile);
So here it happened: you were trying to write data to some memory
location. That would cause a memory access problem.
> printf(sQuote);
Or printf("%s\n",sQuote);
This is just from memory, I have not debugged the thing. But I hope it
helps you a bit further.
Cheers,
Helmut.
+----------------+
| Helmut Walle |
| [EMAIL PROTECTED] |
| 03 - 388 39 54 |
+----------------+