Alternative for Turbo C++

Is there any application on or off the App Store which i can download on my MacBook Pro which is exactly the same as Turbo C++ and uses the same type of commands an libraries for coding. I'm using codelite which I'm not very happy using. I have tried Xcode as well, but feel like making C++ programs is not the easiest job.

MacBook Pro (Retina, 13-inch,Early 2015), OS X El Capitan (10.11.3)

Posted on Aug 17, 2016 9:09 AM

Reply
5 replies

Aug 17, 2016 12:17 PM in response to dhruvdd2000

Turbo C++ was designed for DOS and Windows - released in 1990 and last updated in 2006.


The obvious C++ compiler on macOS would be the one that comes with Xcode, which used to be GCC but is now LLVM.


Your best bet is probably to rewrite your Turbo C++ code using similar MacOS/Unix commands as needed, or find some kind of library that has already done this.


You could also possibly run Turbo C++ directly via Wine, Bootcamp or a DOS/Windows VM (Virtual Machine).

Aug 17, 2016 8:17 PM in response to hokanst

#include<iostream.h>

#include<stdio.h>

#include<conio.h>

#include<math.h>


void main()

{

clrscr();

float amt;


cout<< “\n enter amount of product”;

cin>> amt;


if(amt <= 500)

{

float x;

cout<< “\n discount=0” ;

x= amt;

cout<< “\n billed amount” <<x;

}


if((amt >= 501)&&(amt <= 2000))

{

float x;

cout<< “\n discount=5%”;

x=(amt/100)*95;

cout<< “\n billed amount” <<x;

}


if((amt >= 2001)&&(amt <= 3000))

{

float x;

cout<< “\n discount=10%”;

x=(amt/100)*90;

cout<< “\n billed amount” <<x ;

}


if(amt >= 3001)

{

float x;

cout<< “\n discount=15%” ;

x=(amt/100)*85;

cout<< “\n billed amount” <<x;

}


getchar();

}


The above code is a small sample of what coding i have to do for school purpose, and i can run this without any difficulties on Turbo C++. When i try running the similar code on either codelite or under the C++ option under Xcode, I'm unable too. Please suggest an alternative if any

Regards

Aug 19, 2016 12:29 AM in response to dhruvdd2000

Hello dhruvdd2000,

That is an ancient dialect of C++. You would have difficulty finding a compiler that would do anything with it.


The first thing you need to do is remove the old DOS-specific console I/O references. Remove the "conio.h" header and the "clrscr" function.


Then, change <iostream.h> to just <iostream>.


Then add "using namespace std;" after the include statements.


Finally, change the main() function to return int.


Then, if you compile it with a C++ compiler - g++ or clang++, it should build and you can run it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Alternative for Turbo C++

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.