I'm trying to set up Eclipse with C/C++ but it's been causing me problems and despite trying to find a solution most of the afternoon I'm stumped.
I have the main program set up on my Windows PC (originally installed for Java, but now with the C/C++ plugin) and then followed a video on youtube to install/set up the rest like GCC. I can now compile and run programs successfully within the IDE, but for some reason if there is a scanf() function in the program it gets executed first, even if there is a printf() function before it.
I wrote this small program to test it:
int main(void) {
int amount;
printf("Enter amount: ");
scanf("%d", &amount);
printf("amount: %d", amount);
return (0);
}
When it runs, the program demands input first without executing the print statement. If you enter some input, it then prints Enter amount: amount: value
.
I've been using Eclipse on my mac for a while and it's never caused me any problems...