Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
970 views
in Technique[技术] by (71.8m points)

c - Programs with the scanf not working properly in NetBeans

I've installed NetBeans 7.0.1 today When I try to execute C program with "scanf" in it it's giving strange errors

This is what I wrote:

Program

It keeps on running until I enter something in the output console. enter image description here

After entering its shows the printf statement and shows "RUN FAILED"

enter image description here

Can anybody tell me what should I do to make this right?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, I have same problem with you, and the solutions in answers are not working on my machine. After searching, I understand that this problem is about Netbean's internal terminal/console section. The internal console is not able to run scanf function. So use external terminal for your project. To do this:

  • first right click on your project, and select properties.
  • In that window select "Run" tab at the bottom.
  • in there, there is "Console Type", change this console type from "internal terminal" to "external terminal".

That is all.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...