1

One of my career courses is teaching us the basics of "Turbo C". I was never sure if it was C or C++. So i checked the help and it said "Borland C++ Version 3.0".

But when i go look for help on the web, my code seems to be C.

So which one is it or why is it all mixed?

Lundin
  • 174,148
  • 38
  • 234
  • 367
Emiliano Rodriguez
  • 390
  • 2
  • 4
  • 17
  • 1
    `basics of "Turbo C".`.. and what is that? P.S- I heard about jurassic park. :-) – Sourav Ghosh Apr 22 '15 at 06:22
  • 8
    I struggle to understand why people (Indian universities mostly, it seems) use a compiler that hasn't been updated for 20 years, when there are equally free ones available now (and that are much better in terms of current standards). – paxdiablo Apr 22 '15 at 06:24
  • so if i put C++ code on that dinosaur it should compile and run? gotta try that – Emiliano Rodriguez Apr 22 '15 at 06:25
  • 4
    @paxdiablo Sadly, your observation is correct (I'm from India). Till date, the scenario has not changed much. I myself do not understand the reason and the freshers coming to industry face a lot of difficulties to get over the wrong concepts gathered by using that dinosaur. – Sourav Ghosh Apr 22 '15 at 06:25
  • 5
    Turbo C++ is old, *very old*, from before C++ was standardized in 1998. Which means that while many things are similar to modern C++, many other things aren't. – Some programmer dude Apr 22 '15 at 06:26
  • For somebody who is learning the language that is probably not a big deal. Nevertheless there are plenty of free alternatives nowadays going from linux to visual studio c++ express. – Philip Stuyck Apr 22 '15 at 06:27
  • 1
    Having said that, Emiliano Rodriguez isn't your garden variety Indian name so maybe it's _not_ just in India :-) – paxdiablo Apr 22 '15 at 06:28
  • 4
    Not only do Indian colleges use ancient compilers (Turbo C/C++), they also use really terrible reference books, e.g. Kanetkar "Let Us C", "Let Us C++", which teach such bad habits as `void main` and relying on Undefined Behaviour. – Paul R Apr 22 '15 at 06:28
  • 1
    @PhilipStuyck, I'd steer clear of Express nowadays, the community edition is much better (basically Professional) with no restrictions for this level of use (education, <5-man companies, etc). – paxdiablo Apr 22 '15 at 06:29
  • 2
    @PaulR Yet again, you're very true. :-( – Sourav Ghosh Apr 22 '15 at 06:30
  • @paxdiablo correct, It used to be express edition but now there is the community edition. I use the enterprise edition myself ;-) – Philip Stuyck Apr 22 '15 at 06:31
  • 1
    Im from Argentina. The struggle is too real when it comes to updating the programs. That would mean that the teachers should study to update their knowledge, most of them like to be lazy tho. It's kinda sad. – Emiliano Rodriguez Apr 22 '15 at 06:31
  • I think "Turbo C++" includes a C compiler and a C++ compiler. The same executable does it but it does behave differently for c files. – M.M Apr 22 '15 at 06:35
  • 1
    @PaulR [one example](http://stackoverflow.com/q/27821699/2173917), see the question itself. – Sourav Ghosh Apr 22 '15 at 06:41
  • 1
    @SouravGhosh: (shudder). – Paul R Apr 22 '15 at 06:58

4 Answers4

4

You are able to compile C code with a C++ compiler, with minor changes to the code in some cases. So even if your code is C there is no problem that you are using Borland C++. It is even possible that the compiler will detect that it is a C file and apply different rules.

Philip Stuyck
  • 7,131
  • 3
  • 26
  • 38
3

To check what your compiler is doing, try this program:

int new;

int main() { return 0; }

If this compiles then you are using a C compiler; if not then you are using a C++ compiler. You may be able to control your compiler using compiler switches or by changing the extension of the file you are compiling.

M.M
  • 134,614
  • 21
  • 188
  • 335
2

The oldest compiler by Borland was "Turbo C". It had no C++ support. But later they added C++, so the compiler was renamed to "Turbo C/C++" and then to "Borland C/C++". All these compilers were backward compatible so sometimes people still refer to "Turbo C" while really speaking of Borland C++ etc.

BTW. Borland's compiler chooses "C" or "C++" mode depending on source file extension.

Matt
  • 12,100
  • 1
  • 13
  • 21
1

From wikipedia

In May 1990, Borland replaced Turbo C with Turbo C++.

The name "Turbo C" was not used after version 2.0, because with the release of Turbo C++ 1.0 in 1990, the two products were folded into a single product.

You will be able to directly use most C programs in c++ with just a few changes to the code. Most part of C is supported on C++.

Arun A S
  • 5,886
  • 4
  • 28
  • 40