g++ question about what libraried

Mike Stump mrs@apple.com
Mon Sep 18 03:32:00 GMT 2006


On Sep 6, 2006, at 6:46 PM, Serge Bögeholz wrote:
> Date: Tue, 29 Aug 2006 14:38:28 +1000 (EST)
> From: Serge Bögeholz <serge@turing.une.edu.au>
> To: gnu@gnu.org
> Subject: g++ question

This list isn't for how to program in C++.  This list is for how to  
write a compiler.

> I was writing some code to test the  toupper(ch) library function that
> is found in the cctype library.

cctype is not a library.  We call those things header files.

> I noticed I had not entered the line
>
> #include <cctype>

So, to fix your code, you'd want to add it.

> in my C++ program,  yet my program compiled and ran correctly as  
> though I had.

Yes, incorrect programs are allowed to work, even though they are  
incorrect.

> Why did this work - all the C++ books I've read state that you need to
> include the cctype library if you want to use the toupper(..)  
> function.

Run -E and study the output, also -dM might help.



More information about the Gcc mailing list