Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » problem in eclipse(scanf problem)
problem in eclipse [message #1444068] Mon, 13 October 2014 11:38 Go to next message
Eclipse UserFriend
i frequently use eclipse to do c programs . but when we use a scanf statement in the program the program wont get terminate,and if we give values before the program get terminate,it is showing the correct output. if we manually terminate the program it is showing garbage values.
example program which wrote using eclipse indigo:
#include <stdio.h>
#include <stdlib.h>

int main(void) {
int a,b,addition;
printf("enter a,b no.s");
scanf("%d%d",&a,&b);
addition=a+b;
printf("add of a,b is %d",addition);
}
output ,giving values before termination:
1 2
enter a,b no.sadd of a,b is 3

output,manually termination:
enter a,b no.sadd of a,b is 2147344440
Re: problem in eclipse [message #1444151 is a reply to message #1444068] Mon, 13 October 2014 14:11 Go to previous messageGo to next message
Eclipse UserFriend
Please check the return value of scanf(), see scanf manual page.
Re: problem in eclipse [message #1454591 is a reply to message #1444151] Tue, 28 October 2014 11:05 Go to previous messageGo to next message
Eclipse UserFriend
@ Tauno Voipio

Hi,

can you help me find the scanf manual page, is it over the web or it is in the eclipse,..??
Re: problem in eclipse [message #1454800 is a reply to message #1454591] Tue, 28 October 2014 15:43 Go to previous message
Eclipse UserFriend
The man pages should be installed along with your C translator and library toolkit.

They are usually accessed from the terminal with
man scanf

Google seems to find pretty well the man pages.

Have you tried to leave the mouse cursor resting on the scanf symbol in your CDT source code editor?
Previous Topic:ARM project - adding include paths
Next Topic:Build CDT project without blocking other workspace jobs
Goto Forum:
  


Current Time: Sun Jul 06 21:30:37 EDT 2025

Powered by FUDForum. Page generated in 0.09705 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top