I'm new to C. Here's my code:
/* Using scanf() */
#include <stdio.h>
int main(void) {
int iDec1, iDec2, iDec3;
printf("Enter three decimals:\n");
scanf("%d,%d,%d", &iDec1, &iDec2, &iDec3);
printf("Your decimals are %d, %d and %d.", iDec1, iDec2, iDec3);
return 0;
}
It works in the Command Prompt, but when I run it through Eclipse it doesn't do anything. After hitting stop, this appears in the Console output:
Enter three decimals
Your decimals are 3, 2147344384 and 2147344384.
What the...? How come it works fine outside Eclipse but not inside Eclipse?