Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » puts() does not work as expected ...
puts() does not work as expected ... [message #882249] Wed, 06 June 2012 01:50 Go to next message
Eclipse UserFriend
Hi ,

in my indigo eclipse cdt the output of the following code comes out like this -

russel
Enter boyfriend's name:
Dear russel.

You're history.


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

int main() {

	char ex[20];
	puts("Enter boyfriend's name:");	
	scanf("%s", ex);
	printf("Dear %s.\n\n\tYou're history.\n", ex);
	return 0;
}


But in cygwin it is correct like this -

adnan@adnan-PC /cygdrive/e
$ gcc test.c -o test

adnan@adnan-PC /cygdrive/e
$ ./test
Enter boyfriend's name:
Russel
Dear Russel.

        You're history.

adnan@adnan-PC /cygdrive/e
$



Please somebody advise, I am new to eclipse cdt.

Thanks in advance
Adnan

[Updated on: Wed, 06 June 2012 01:59] by Moderator

Re: puts() does not work as expected ... [message #882285 is a reply to message #882249] Wed, 06 June 2012 03:33 Go to previous messageGo to next message
Eclipse UserFriend
see http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows
Re: puts() does not work as expected ... [message #884970 is a reply to message #882285] Tue, 12 June 2012 03:37 Go to previous message
Eclipse UserFriend
Thanks Mueller, it works. ..

(I was not notified that somebody replied, so seeing lately ...)
Previous Topic:Excluding a directory but re-including certain files?
Next Topic:VM arguments
Goto Forum:
  


Current Time: Thu Jul 03 13:19:31 EDT 2025

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

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

Back to the top