Trouble Installing and Running C Programs in VS Code #164833
-
Select Topic AreaQuestion BodyHi everyone, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @youssef394948 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Sure! Here's a plain text version you can directly paste into the GitHub Discussions post—clear, concise, and discussion-style: Hi @youssef394948, To properly set up C programming in Visual Studio Code on Windows, follow these steps:
"code-runner.runInTerminal": true,
"code-runner.executorMap": {
"c": "gcc \"$fileName\" -o \"$fileNameWithoutExt\" && \"$fileNameWithoutExt\""
},
"code-runner.saveFileBeforeRun": trueThis makes sure:
#include <stdio.h>
int main() {
int x;
printf("Enter a number: ");
scanf("%d", &x);
printf("You entered: %d\n", x);
return 0;
} |
Beta Was this translation helpful? Give feedback.
Hi @youssef394948
To set up C programming in VS Code on Windows, a great solution is to install MinGW (Minimalist GNU for Windows). Start by downloading and installing MinGW from MinGW, and make sure to add its bin directory to your system's PATH environment variable. After that, install the C/C++ extension by Microsoft in VS Code for features like IntelliSense and debugging. This will allow you to compi…