I am trying to learn C and am using vscode on mac. I have installed the C/C++ extension and the Coderunner extension. I have also enabled the ‘run in terminal’ setting for Coderunner.
I also have clang and gcc installed.
Whenever I write a C program for the first time and click ‘Run Code’, it works fine and I get the output in the terminal. However, whenever I try to run it a second time, it just says ‘zsh: killed’
I have also tried compiling the file and then running it with ‘./helloWorld’. Again, it works fine the first time. But then it says ‘zsh: killed ./helloWorld’
What should I do?
Here is my clang version:
jonathanyang@Jons-Mac cProgramming % clang -v
Apple clang version 12.0.0 (clang-1200.0.31.1)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Here is my gcc version:
jonathanyang@Jons-Mac cProgramming % gcc -v
Configured with: –prefix=/Library/Developer/CommandLineTools/usr –with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.31.1)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Is there something I am missing? What is the zsh killed error?
2