I have been using Turbo C++ for 1 year now, thing is… i know it’s extremely old, but now i have got used to it’s syntax.Can you suggest a (better) IDE which doesn’t show any error with turbo C++ code?
I have tried visual C++ and codeblocks, and even tried (really wildly) an eclipse CDK pack. But, all of them show errors to a normal programme like:
#include<iostream.h>
void main()
{cout<<"hello";}
I have been using Turbo C++ for 1 year now, thing is… i know
Share
The problem with Turbo C++ being so old is that it is much less conformant than modern compilers. Ages ago C++ compilers all varied wildly; supporting different features, different syntaxes, and had severe bugs in their C++ implementations. Back then writing portable C++ was difficult. Things have vastly improved over the last 15 years as compilers matured with got better and better about implementing the common C++ standard.
So probably the major benefit of modern compilers is that they are more conformant; that they don’t support the same wrong dialect of C++ that Turbo C++ supported.
Instead of asking for a modern C++ compiler that doesn’t have the major feature that makes modern compilers desirable, you should simply figure out the areas of Turbo C++’s dialect which are not correct. This is probably a good exercise anyway; C++ programmers learn a fair bit of C++ from their compiler, and so when the compiler is wrong they learn wrong things. Using different compilers helps ferret out such misunderstandings and improves one’s knowledge of C++. It shouldn’t be too hard to make the adjustments.
So here’s what’s wrong with the simple program you posted as far as the authoritative ISO specification for C++: Standard C++ headers don’t have ‘.h’ suffixes on them, so instead of
#include <iostream.h>you must use#include <iostream>. These standard headers put things in namespaces, so in order to accesscoutyou have to access it inside thestdnamespace: instead ofcout<<"hello";you should writestd::cout << "Hello\n";. Finallymainis required to returnintrather thanvoid, so your whole program might look like: