On Fri, 28 Mar 2003 00:07, you wrote:
> 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)
And it's quite a good idea to get into the habit of putting the constant
first when you test for equality vis:
if(NULL == myfile)
because
if(NULL = myfile)
will throw a compile-time error.
Also, always use a #define for constants so that should you need to change one
it gets changed in all the right places at the same time. During these
'intersting times' in which we are currently living this is particularly
important. Buffer sizes and the number of items read into them must _always_
correspond, and it's easy in the extreme to miss a constant if you have to
hunt through all the source code to find them all.
--
C. S.