Mail Archives: djgpp/1999/09/06/14:26:47
On Mon, 6 Sep 1999, Manni Heumann wrote:
> The C library was also written in C. Nevertheless functions like printf take a
> const char* as their first argument.
The library sources sometimes need to go to great lengths to do this,
because the compiler doesn't like it when you take a const char * and
pass it to a function that accepts a char *. If a library function needs
to call another library function, it might be a royal PITA to struggle
with these problems. Download djlsr202.zip and search for "unconst" to
see what I mean.
This is what Shawn meant when he said that const tends to propagate
through the entire source.
- Raw text -