This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 241553 - C Putchar() doesn't display character in a simple K&R program
Summary: C Putchar() doesn't display character in a simple K&R program
Status: RESOLVED DUPLICATE of bug 225956
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 7.4
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-07 21:37 UTC by darkblue
Modified: 2014-02-10 11:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description darkblue 2014-02-07 21:37:19 UTC
I'm reading Kernighan and Dennis Ritchie The C Programming Language.
I've setup NetBeans 7.4 with latest MinGW (gcc.exe is v4.8.1) in win8.1 x64.


This is a simple program of the book:


#include <stdio.h>

/* copy input to output; 2nd version */
main() {
    int c;
    while ((c = getchar()) != EOF)
        putchar(c);
}



The problem is that only the getchar() command works ok - 
the putchar doesn't display what I just typed.

Just tried it in "Orwell Dev-Cpp 5.6.0 MinGW 4.8.1 Portable"
and even "Dev-Cpp 5.6.0 TDM-GCC x64 4.8.1 Portable"
and there it works as expected.
Comment 1 darkblue 2014-02-07 21:50:48 UTC
Also, the problem appears only with the default setting at:rightclick on my C project
Comment 2 darkblue 2014-02-07 21:55:03 UTC
^ (From my comment above only the 1st line was posted for some reason)
Here it is again:


Also, the problem appears only with the default setting at:
rightclick on my C project>Properties>Run>Console Type>Internal Terminal.

If I change it to "External Terminal" the problem no longer appears.
Comment 3 darkblue 2014-02-08 10:49:55 UTC
As I've read in https://netbeans.org/bugzilla/show_bug.cgi?id=213808 
even with Cygwin(instead of MinGW), it also doesn't work well in local case.

So, let's hope that it will be fixed in some future NetBeans version?
Comment 4 Vladimir Voskresensky 2014-02-10 11:21:58 UTC

*** This bug has been marked as a duplicate of bug 225956 ***