Can't run C programs properly [message #1033479] |
Thu, 04 April 2013 05:14  |
Eclipse User |
|
|
|
Hello all, I use Eclipse for C programs and that runs absolutely fine on Ubuntu. However, it is not same for Windows. I use Eclipse on WinXP SP3. I have downloaded Eclipse Classic and have installed new software for C support. I have MinGW installed & system variable set properly on my Windows machine.
I can run the preloaded "Hello World !" program in Eclipse - it gives correct output. But other programs are not running properly. For example, take this code snippet :
---------------------------
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i;
printf("Hello World !\n");
printf("Hello World !\n");
printf("Enter an integer : ");
scanf("%d", &i);
printf("The entered integer was : %d", i);
return 0;
}
-----------------------------
I can build the project without any error but it doesn't run properly. When I click on run button it displays nothing in the "Console" window. However, after clicking the red-colored square-shared "Terminate" button, I get the following output :
-----------------------------
Hello World !
Hello World !
Enter an integer : The entered integer was : 2147348480
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03863 seconds