How To Set Up Atom For C Programming

1. Introduction 

Atom is a free and open source text and powerfull source-code editor for Windows, macOS and Linux.
It comes with built-in support for plug-ins written in JavaScript, and embedded Git Control. 

Atom's default packages can apply syntax highlighting for multiple programming languages and file formats (such as C, C++, C#, Java, Python, PHP, Etc).

In this tutorial you will learn how to set up Atom on your local environment for C and C++.

2. Requirement

3. Install Atom packages

  1. Open Atom, Go to Start Menu > type : Atom.
  2. Click on the File menu, click on Settings.

    atom for c programming

  3. Click on the "Install" tab.
  4. Install “gpp-compiler” packages
    • Search for “gpp-compiler”, type in the box under Install Packages.
    • Click the “Install” button to install the packages.

      atom for c programming

  5. Now we have successfully installed code editor.

4. Install a compiler (MinGW)

5. Create C Program

To make sure the compiler is installed and configured correctly, we'll create the simplest C program.
  1. Click on the File menu, click on “Add Project Folder...”.

    atom for c programming

  2. Browse your C workspace (folder), navigate to save workspace (folder) (ex: D:\Program\Atom\).

    atom for c programming

  3. Now create a new file called “hello.c”, right click in the Project Explorer and click on “New File”, or click on the File menu > click on New File.

    atom for c programming
     
  4. Type “hello.c” into the box under “Enter the path for the new file”.

    atom for c programming

  5. Write and save your first C program. Press "Ctrl+S" to save. Ex :


6. Compile and run C program in VS Code

Once you created your first C program it's time to compile and run your program.
  1. Press F5 or right click the file in tree view and click Compile and Run.

    atom for c programming

  2. You should see the output "Hello, DnD!".

    atom for c programming

Thanks for reading!

Tidak ada komentar:

Pembaca yang baik selalu meninggalkan komentar sesudah membaca ^_^
Terimakasih sudah mengisi komentar

Diberdayakan oleh Blogger.