473,508 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with eclipse and a simple c program

I have some problems when this simple program run with eclipse:

#include <stdio.h>
#include <stdlib.h>

int main()
{
int number;
printf("Enter a number\n");
scanf("%d", &number);
printf("You entered %d", number);
return 0;
}

In run mode on consolle nothing appear, "enter a number" appears only
after the inserction of a number and not before. Why?
Thanks
Dec 12 '07 #1
2 1720
li***************@gmail.com wrote:
I have some problems when this simple program run with eclipse:

#include <stdio.h>
#include <stdlib.h>

int main()
{
int number;
printf("Enter a number\n");
scanf("%d", &number);
printf("You entered %d", number);
return 0;
}

In run mode on consolle nothing appear, "enter a number" appears only
after the inserction of a number and not before. Why?
Thanks
When I run this from a console it works correctly here
(windows vista 64/ lcc-win compiler)

Maybe in some systems you have to write
fflush(stdout);
after the printf statement. Try that.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 12 '07 #2
li***************@gmail.com wrote:
I have some problems when this simple program run with eclipse:

#include <stdio.h>
#include <stdlib.h>

int main()
{
int number;
printf("Enter a number\n");
scanf("%d", &number);
printf("You entered %d", number);
return 0;
}

In run mode on consolle nothing appear, "enter a number" appears only
after the inserction of a number and not before. Why?
This is Question 12.4 in the comp.lang.c Frequently
Asked Questions (FAQ) list at <http://www.c-faq.com/>.

--
Eric Sosman
es*****@ieee-dot-org.invalid
Dec 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2998
by: ttn | last post by:
Hi, I am using a separately downloaded Eclipse 3M5 on a Debian woody (stable) system. To make Eclipse start at all I had to use the libgtk2 libraries from some backported gnome 2.2 to get a gtk...
29
3619
by: seberino | last post by:
I'm trying to move beyond Emacs/Vim/Kate and was wondering if Eclipse is better and if it is the *best* IDE for Python. Should I leave Emacs and do Python coding in Eclipse? Chris
0
1947
by: Nova | last post by:
Hi, I created a Java UDF (PARAMETER STYLE JAVA) for DB2 9 Express-C. I finally does what I want it to do. However, after a few hundred calls to the UDF, it fails and raises an SQL error,...
0
1312
by: Dmon | last post by:
Hello everyone, I am almost certain that this is a PDT<->Subclipse issue, and I thought by asking here I would get something from someone who also had the issue. As I surfed the web for a while...
5
2444
by: gerardsmink | last post by:
Hello, I have written a java program that can connect with a mysql server. When i run the program in Eclipse it works fine, when i create a jar and run the program outside eclipse the program...
4
14338
by: Kid Programmer | last post by:
Hello. I am encountering trouble while using the Eclipse software for C++ development. I am rather new to C++ programming and spent a while looking for a program as you may see in one of my post...
4
2060
by: Gangreen | last post by:
ok, this might be a very stupid question, but I have googled, and I'm still stuck with it. I'm working on vista btw. I downloaded eclipse for C/C++, created a new project, and entered a simple...
1
1274
by: thesti | last post by:
hello, i've made a java program by using jdk6-update7 (eclipse as the IDE). then i bring the eclipse project to another computer which only has a jre5.1, when i run test to run the program, the...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.