It’s very easy to start C/C++ on Mac.
Install Xcode and Command line tools
You need to install Xcode. Open App Store and install “Xcode”.
Download and Install
Download and install visual studio code.
Install C/C++ extension.
Open visual studio code and install C/C++ extension. It makes your coding easy.
File->new file and write down (or copy and paste) the following code.
Save the file (File -> Save As) as “HelloWorld.cpp”.
Open terminal and move to the directory where you save HelloWorld.cpp. Compile HelloWorld.cpp as follows.
> c++ HelloWorld.cpp > ./a.out Hello, World!
You can see “Hello World!”. Congratulations.