Issue
I have installed MinGW on netbeans for C and C++ programming.
Here is a simple code that I am trying to run on netbeans :
#include <stdio.h>
int main(int argc, char** argv) {
printf("Inside Main...\n");
int n;
printf("Enter : ");
scanf("%d", &n); // When I remove this line, it is working.
printf("You have entered %d.", n);
return (1);
}
Whenever I try to access any value from netbeans console, I don't see anything.
Output with scanf(...)
Output without scanf(...)
And if I try to run these code from cmd, all are working
Solution
for scanf()
you must use Netbeans External Terminal
!
Normal Run
You can also use Netbeans Standard Output
!
But this is more misleading.
While you see an empty Terminal do input 123
after hit enter , you get the output all at once .
Answered By - moskito-x
Answer Checked By - Robin (JavaFixing Admin)