Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumscan anyone good with eclipse look at my console error? There was no error before and no error in com
https://www.eclipse.org/forums/index.php/mv/msg/1092572/1784671/#msg_1784671
This question may already have an answer here:
printf not printing on console 7 answers
So I have windows 10, MinGW64 installed with Eclipse C/C++ Development tool. Right now I have no idea why my eclipse console is not displaying right. The problem kind goes away if I use fflush after printf. But in my old eclipse I never had this problem.
In my windows command prompt everything works fine:
C:\Users\Jwill\Documents>gcc -o cal.exe cal.c
C:\Users\Jwill\Documents>cal
Enter an operator (+, -, *,): +
Enter two operands: 2 4
2.0 + 4.0 = 6.0
This is my code:
#include<stdio.h>
int main() {
char operator;
double firstNumber,secondNumber;
printf("Enter an operator (+, -, *,): ");
//fflush(stdout);
// operator doesn't match any case constant (+, -, *, /)
default:
printf("Error! operator is not correct");
}
return 0;
}
When I compiles and run this C code in my eclipse, everything shows up blank in my console. Then I typed + and 2 and 2 and it compiles but not displaying right.
+
2
2
Enter an operator (+, -, *,): Enter two operands: 2.0 + 2.0 = 4.0
This problem will appear in every C code if I don't comment out fflush. In my old eclipse I never had this problem and didn't have to use fflush.]]>eric chen2018-04-01T21:39:26-00:00Re: can anyone good with eclipse look at my console error? There was no error before and no error in
https://www.eclipse.org/forums/index.php/mv/msg/1092572/1784738/#msg_1784738
You should check the checkbox in your launch configuration and also you should either use newlines in your printf calls or call fflush.
]]>Ilya Basin2018-04-03T11:37:32-00:00