Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write C++ on Mac? [closed]

Tags:

c++

macos

ios

Taking my first C++ class in college. I need to download C++ and my teacher gave us a direct link to download it, but it only works on Windows. Is there a way I can format it to work on my Mac or is there a Mac-friendly version I can download?

like image 940
user3302376 Avatar asked Feb 12 '14 15:02

user3302376


3 Answers

A compiler for C++ is already built into Mac (try g++ main.cpp in terminal). If you mean an IDE for C++, use Xcode 5, available in app store.

It's developed by Apple, has git integration too if that's useful to you. Also has templates and such available to entice you to work on OS X/iOS projects, which might be a nice way in for you (I'm just starting out too, and I think that could be good).

For command-line projects though, I find it best to write in Xcode, then compile and run from the terminal. It's easier for file I/O and passing arguments to stdin IMO.

like image 196
OJFord Avatar answered Oct 05 '22 08:10

OJFord


You can utilize something called Xcode IDE to write your programs on C++, I have been using that for a quite a while now, and it's definitely fun. You can find the app from free on APP store or just by clicking the link below. This is one of the many things I like about MAC.

click here to get XCODE

like image 31
Sudeep Devkota Avatar answered Oct 05 '22 09:10

Sudeep Devkota


On Mac, since you are just starting out, use XCode. Its a pretty neat IDE with built in C++ compiler so you can write C++, compile with a click and run.

like image 41
ak_2050 Avatar answered Oct 05 '22 09:10

ak_2050