[Ilugc] Compiling XIIth standard State Board code on Linux

  • From: roshan@xxxxxxxxx (Roshan George)
  • Date: Fri Dec 4 21:20:02 2009

Hello, everyone,

My younger brother is in the XIIth standard at the moment, and is
required to write some basic C++ code in his practical exams. I have an
extra desktop running Ubuntu 9.10 on which I installed the basic stuff
(g++ 4.4, libstdc++6).

The students at his school are taught under the State Board curriculum,
and unfortunately the code they're supposed to replicate has the
following characteristics (and hence does not compile under g++ 4.4):

1. Uses stuff like:
        #include <iostream.h>
   instead of:
        #include <iostream>

   and as a result,

2. The objects cin, cout, ... are all assumed to be in the global
namespace.

3. main is declared 'void' instead of 'int'.

I'm pretty sure that iostream.h is deprecated and that using 'void main'
is not standard compliant?. However, I need this to compile.

Here are my questions:

1. What is the newest version of g++ and libstdc++ on which code like
this will successfully compile?
2. How do I install these safely alongside my current Ubuntu
installation?
3. I assume this sort of code is common across all schools. Does anyone
know if the state board accepts more modern code? In this case, I will
just inform the school.

? Please feel free to correct me, I'm no programmer.

Thank you for reading,
-- 
Roshan George <roshan@xxxxxxxxx>

Other related posts: