In this tutorial, you’ll learn in Detail how to Run C++ Program on Mac OS.
The easiest way to Run C++ Program on Mac OS X is by downloading XCode.
- Go to the download page of apple developer site.
2. Click the download Xcode link. It’s recommended to download the latest version even if it’s in beta.
3. Whe the download is completed, open Xcode and follow the wizard to install it. You might want to put the Xcode in Applications for future use.
4. Then, open Xcode and go to File > New > Project
5. Under OS X section, choose Application, choose Command Line Tool and hit next.
6. Provide the Product Name, for example: Hello. And, choose C++ under Language section. Then, click next.
7. Choose the location where you want to save the project in your Mac. You can uncheck Create Git repository button and click create.
8. Navigate to main.cpp file in the screen where you can see default code provided by XCode.
9. Change the code as you wish. And finally to run the code, go to Product > Run or simply hit Cmd + R.
10. By default, you will see the output at the bottom of your screen.