I am compiling a simple program written in C, and I use Eclipse as an IDE, both on Windows 7 and on my MacBook Pro. A very simple program that my friend wrote and asked me to help him:
int a = 0; char b[2]; printf("Input first class info:\n"); printf("Credit Hours: \n"); scanf("%d", &a); printf("Letter Grade: "); scanf("%s", b);
Therefore, when I run this on my mac, each line prints, and when I run into scanf (), I can enter and continue as expected. On Windows, I have to enter everything and then print all the lines. I'm not sure why this is happening ... what is the difference between Windows and Mac here?
Mac:
Input first class info: Credit Hours: 4 Letter Grade: B+
Window:
4 B+ Input first class info: Credit Hours: Letter Grade:
Thank you Christo
source share