C
  • Introduction
    • Fundamentals of a Program
    • Overview of C
    • Features of C
  • Installing Required Software
    • Setting Up VSCode for Windows
    • Setting Up VSCode for macOS
    • Setting Up VSCode for Ubuntu
  • Starting to write code
    • Compiling and Running Your Code
    • Creating Our First C Program
    • Errors and Warnings
    • Program: Writing a C Program to Display Your Name
    • Structure of a C Program
  • Basic Concepts
    • Comments in C
    • Preprocessor in C
    • The #include Statement
    • Displaying Output
    • Reading Input from the Terminal
    • Enums and Chars
    • Data Types and Variables
    • Format Specifiers
    • Command Line Arguments
    • Program: Calculating the Area of a Triangle
  • Operators
    • Converting Minutes to Years and Days
    • Basic Operators
    • Bitwise Operators
    • Program: Byte Sizes of Basic Data Types
    • cast and sizeof Operators
    • Operator Precedence
  • Control Flow
    • If-Else Statements
    • Program: Weekly Pay Calculation
    • Switch Statement
    • For Loop
    • While and Do-While Loops
    • Nested Loops and Loop Control
    • Program: Guess the Number
  • Arrays
    • Introduction to Arrays
    • Program: Prime Number Generator
    • Multidimensional Arrays
    • Program: simple Weather Program
    • Variable Length Arrays (VLAs)
  • Functions
    • Overview of Functions
    • Defining Functions
    • Arguments and Parameters
    • Returning Data from Functions
    • Variable Scoping
    • Program: Tic Tac Toe Game
    • Recursion
  • Strings
    • Defining a String
    • Constant Strings in C
    • Common String Functions
    • Program: Bubble Sort
    • Searching, Tokenizing, and Analyzing Strings
    • Converting Strings
  • Debugging
    • What is Debugging
    • Understanding the Call Stack
    • Common C Mistakes
    • Understanding Compiler Errors
  • Pointer
    • Defining Pointers
    • Accessing Pointers
    • Program: Pointer Demonstration
    • Pointers and Const
    • Void Pointers
    • String Pointers
    • Array Pointers
    • Utilizing Pointers with Functions
    • Pointer Arithmetic
  • Dynamic Memory Allocation
    • malloc, calloc, and realloc
    • Program: User Input String
    • Memory Deallocation
  • Structure
    • Structures and Arrays
    • Nested Structures
    • Structures and Pointers
    • Structures and Functions
    • Program: Structure pointers and Functions
  • File Input and Output
    • Accessing Files
    • Reading from a File
    • Program: Finding the Total Number of Lines in a Text File
    • Writing to a Text File
    • Finding Your Position in a File
    • Program: Converting Characters in a File to Uppercase
    • Program: Printing the Contents of a File in Reverse Order
  • The Standard C Library
    • Various Functions in C
    • Math Functions in C
    • Utility Functions in C
Powered by GitBook
On this page
  • Step 1: Download and Install Visual Studio Code (VSCode)
  • Step 2: Install C/C++ Extension
  • Step 3: Install a C Compiler (MinGW)
  • Step 4: Add MinGW to System Path
  • Step 5: Create a C File and Compile
  • Step 6: Explore Other IDEs (Optional)
  • Conclusion

Was this helpful?

  1. Installing Required Software

Setting Up VSCode for Windows

PreviousInstalling Required SoftwareNextSetting Up VSCode for macOS

Was this helpful?

Step 1: Download and Install Visual Studio Code (VSCode)

  1. Visit the official .

  2. Download the installer for Windows.

  3. Run the installer (.exe file) and follow the on-screen instructions to install VSCode.

Step 2: Install C/C++ Extension

  1. Open VSCode after installation.

  2. Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or using the keyboard shortcut Ctrl+Shift+X.

  3. In the Extensions view search box, type "C/C++".

  4. Install the extension provided by Microsoft.

Step 3: Install a C Compiler (MinGW)

  1. Download and install MinGW (Minimalist GNU for Windows):

    • Visit the .

    • Click on "Downloads" in the left sidebar.

    • Download the installer for your architecture (32-bit or 64-bit).

    • Run the installer and follow the installation instructions.

Step 4: Add MinGW to System Path

  1. After MinGW installation, locate the installation directory (e.g., C:\MinGW).

  2. Add the MinGW bin directory to the system Path:

    • Right-click on "This PC" or "Computer" on your desktop or in File Explorer.

    • Select "Properties" > "Advanced system settings."

    • Click on "Environment Variables."

    • In the "System variables" section, find and select the "Path" variable, then click "Edit."

    • Click "New" and add the path to the MinGW bin directory (e.g., C:\MinGW\bin).

    • Click "OK" to close the windows.

Step 5: Create a C File and Compile

  1. Open VSCode.

  2. Click on "File" > "New File" to create a new file.

  3. Save the file with a .c extension, for example, hello.c.

  4. Write your C code in the editor.

  5. Open the terminal in VSCode.

  6. Compile the code using the following command:

    gcc hello.c -o hello
  7. Run the compiled program:

    hello

Step 6: Explore Other IDEs (Optional)

While VSCode is a great choice, you can explore alternative IDEs for C programming on Windows:

Choose an IDE that best suits your preferences.

Conclusion

This guide has helped you set up Visual Studio Code for C programming on Windows. Whether you continue with VSCode or explore other IDEs, make sure to choose the one that enhances your coding experience. Happy coding!

Dev-C++:

Code::Blocks:

VSCode website
MinGW download page
Download Dev-C++
Download Code::Blocks