Re: Programs with if statements not working

From: Richard Heathfield (
Date: 01/06/04

Date: Tue, 06 Jan 2004 13:13:07 +0000

Andre' Poenitz wrote:

> Ken <> wrote:
>> I am very new to programming in C++ and I interpreted your advice
>> "include the header <climits> to use 'INT_MAX' " and did the
>> following:
>> #include <iostream> <climits>
>> and got this warning - [Warning] extra tokens at end of #include
>> directive.
>> I don't know what that means. Did I do it incorrectly?
> Yes. You need two lines:
> #include <iostream>
> #include <climits>

I must admit it had never occurred to me to attempt to put two headers on a
single include line but, now that it's on the table, it strikes me that it
could usefully be included in the language! Perhaps as a comma-separated

#include <iostream>, <climits>, <string>, "myhdr.h", "myotherhdr.h"

with a strict L-to-R order being observed. This would, as far as I can tell,
break no existing code, so it would be a harmless change - and would
parallel the perfectly legal:

    int i, j, k, l, m;

syntax of declaration. What's more, the same change could be applied equally
well in C, too.

No? You don't think the committees'll go for it? Well, neither do I, I'm
afraid. ("We have more important things to worry about", or whatever.) Such
is life.

Richard Heathfield :
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
K&R answers, C books, etc: