Emiliano Rodriguez
Emiliano Rodriguez

Reputation: 494

Is Borland C++ not C++?

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?

Upvotes: 1

Views: 1543

Answers (4)

Arun A S
Arun A S

Reputation: 7006

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++.

Upvotes: 1

Matt
Matt

Reputation: 15081

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.

Upvotes: 2

M.M
M.M

Reputation: 141544

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.

Upvotes: 3

Philip Stuyck
Philip Stuyck

Reputation: 7447

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.

Upvotes: 5

Related Questions