Environment Setup

If you are going to start programming on C then you need to create environment for it. If you are using Linux operating System then you have nothing do. You will get it preinstalled. It Use GCC compiler in Linux. But if you are using Windows then you have to install the IDE first. You can choose any of mentioned below:
  1. Visual Studio Code
  2. Eclipse
  3. Dec-C++
  4. CodeLite
  5. etc




To use in Windows you have to follow following things
  • Download IDE any of mentioned Above
  • Install the Compiler. You have to install minGW
    • Download minGW from https://sourceforge.net/projects/mingw/
    •  Add the directory where you install MinGW plus bin. Example: if you install MinGW in C:\ then you have to add C:\mingw\bin to your path
Now you can run compile the C program and run it.

For Windows User:

For the Easy way to startup on windows using visual studio use following instructions:
  • Open Visual Studio Code.
  • Install C/C++ Extension on VS.
  • Write Basic Syntax for test.
  • Save it as Main.C
  • Add new Terminal
  • compile it using GCC.
    • To compile it write $ gcc main.c
    • To run file write $ ./a.out
      • ./a.out means if you compile the file then it will automatically compile it as a.out or a.exe file and you have to run it. 
  • Now your file will run.
Watch this video for it.
For Linux User
For Linux user you can use any text editor.
  • Write a program.
  • Open Terminal using Ctrl+Alt+T
    • To compile it write $ gcc main.c
    • To run file write $ ./a.out



0 Comments had been done yet:

Post a Comment