What are the differences between Turbo C++ 7 and Dev C++ in terms of syntax?

2.2k Views Asked by At

In school I was taught C++ using Turbo C++ 7 . When I entered college , I found out that it was out dated . I would like to know the changes which have been implemented in C++ 14 in GCC or Dev C++ compiler.

Example : conio.h does not exist in C++98, C++14 etc. instead we have using namespace std; .

2

There are 2 best solutions below

4
On BEST ANSWER

From what you say (and reference to conio.h), the most likely conclusion is that you were not taught C++ (using Turbo C++ 7). You were taught "C with some C++ features sprinkled over". What some ambiguously call "C/C++". That's what most learn in good high schools, and it can serve you well through coding competitions.

So follow these steps:

  1. accept that you don't know C++ (or that "what you know is not real C++")
  2. go over the introductory "A Tour of C++" from Bjarne Stroustrup, the guy who created C++, and fill in the gaps between "what you know" and "modern C++"
  3. read a bit about the differences between the language features of various C++ standard versions (start by google-ing "C++14 features" etc.)
  4. pick a good C++ book, like maybe "Effective C++" (or others, ask around a bit!) and go through it alongside your courses in the first few years of college

Tip: Somewhere between 3 and 4, when you'll realize it's going to take you years and years to master C++, stop and ask yourself "is C++ the right language for the kinds of programs I want to write?". If the answer is "no", pick something else. If the answer is "yes", then pause and take some detours: a couple detours to the "underworlds" of assembler and "real plain C" (the type you find in Linux's kernel), and a couple detours to the "alternative universes" of D, Rust and Go, to understand what's wrong with C++ and why it's responsible for most of the world's bugs and security holes (hint: there's a lot wrong!), and how to mitigate its anti-features.

Oh, and... don't despair :)

0
On

Notice that <conio.h> does not exist in any programming language standard. You could check with the C11 draft standard on n1570. You could check with the C++14 standard too (and you could check with all earlier standards of C or of C++). FWIW, I'm coding since the 1970s and never used <conio.h>

I'm using a good, very standard conforming, implementation of C11 and of C+14 and it has no <conio.h>. My computer runs Linux and my compiler is GCC 7.

The <conio.h> header is specific to MicroSoft systems. AFAIK no standard mentions it. You won't find <conio.h> on POSIX (and all non-MicroSoft) systems (you should prefer ncurses for POSIX, it is a free software library commonly used). Even 1990s era Unix workstations did not have
<conio.h> and current non-Microsoft systems don't have them.

TurboC++ is an obsolete compiler. It compiled an obsolete, never standardized, variant of a subset of C++. Don't use TurboC++ today!

BTW, DevC++ (or Code::Blocks) are not compilers, but IDEs. They are running some (configurable) compiler, often GCC.

I strongly recommend using some recent free software C++ compiler, notably GCC or Clang/LLVM. Both are very standard conforming (with some tiny documented deviations).

Don't forget to enable all warnings and debug info (most compilers don't enable them by default). With GCC compile with g++ -Wall -Wextra -g.

I even very strongly recommend installing some Linux distribution on your computer, because they are very developer friendly and made of free software whose source code you can study.

If you want to learn C++, be sure to learn and use at least C++11 (and preferably C++14, which is very close to C++11). Any older standard is not worth learning (unless your employer forces you to) in 2017.

Of course, a C++ compiler alone is not enough (BTW nearly all of them are command line programs). You also need other tools, notably linkers and loaders and assemblers (e.g. binutils); you need some source code editor (my preference is GNU emacs but you could use vim or gedit or many others) - some of them call themselves IDEs - and you want to use a debugger (such as GNU gdb), a version control system (I recommend git), a build automation tool (like GNU make).

Most Linux distributions are packaging all that very nicely.

Once you have read a good introduction to C++ programming, take the habit to look on cppreference. Be aware that C++ is a very complex programming language (and few people know it very well, I don't claim to know it well and probably never met any person knowing it very well), so prepare yourself to spend several years learning it. An important notion is that of undefined behavior.

BTW, the most important differences between the language accepted by TurboC and the C++14 standard are not syntactic, but semantics.