Here is my simple code :
#include <stdio.h>
int main(){
printf("Hello new world\n");
char c[10];
scanf("%s",c);
printf("%s",c);
return 0;
}
Normal, We will see: Hello new world, after that, we input some string, and C will print this string for us.
But in my eclipse CDT, when running, console is empty. I must input a string first, for example, stackoverflow. after that, my program will print :
Hello new world
stackoverflow
I don’t know why happen, please teach me to fix this.
Thanks 🙂
It’s something that developers of Eclipse do not consider for a bug.
You can read more about this “bug” here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732
Anyway… Ugly but working solution is to put
after every printf() and puts().