....g++ (as well as borland bc5++) balked at all your malloc's.
I added casts and all is fine.
Yeh...,
I have read that (in C) mallocs should not be type-cast.
Sometimes I
do, only when a compiler requires it.
It could be because you were using g++ (and Borland C++), which may be assuming that it is a C++ file, with C code inserted.
C and C++ compilers are not the same.
Things like that happen when I use VC++.
I have to tell VC++ to compile C, otherwise I get warnings and errors.
edit:
C code should not be compiled as C++ code.
Even though all C++ compilers will compile C code (not really, tho) they expect the code to conform to C++ requirements.
You have to specifically tell the compiler to compile C source code as a C file.
Otherwise, you are compiling and producing a C++ file and executable.
LccWin32 only compiles plain-jane C.
Most compilers out there (link MingW) are C/C++.
Meaning that they contain both a C and C++ compiler.