I am trying to do a simple code in C using the text editor Sublime. The problem is, when I try to use the scanf function I get an error.
#include<stdio.h>
#include<stdlib.h>
int main(){
int a;
scanf("%d",&a);
printf("testing %d",a);
return 0;
}
The error:
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot open output file cccc.exe: Permission denied collect2.exe: error: ld returned 1 exit status
a = 42; //scanf("%d",&a);
– pmgscanf
gathers input fromstdin
; programs executing in Sublime's output panel have nostdin
connected to them; thus they hang forever waiting for input that you cannot provide. You assume your code is broken and try to run it again, but the previous version is already running, which has the file locked, and the linker is unable to relink. Extremely common problem (but finding it on SO is very difficult). The answer to the question is to not run interactive programs directly within Sublime. – OdatNurd