Like Tree1Likes
  • 1 Post By nonpuz

Problem Executing Programs

This is a discussion on Problem Executing Programs within the C Programming forums, part of the General Programming Boards category; Hi, everyone. I'm having a problem on my computer, a problem that hadn't happened since I started compiling programs in ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    114

    Problem Executing Programs

    Hi, everyone. I'm having a problem on my computer, a problem that hadn't happened since I started compiling programs in C, at least from what I remember. I use Windows XP and the Open Watcom compiler, and some of my programs aren't doing anything when executed - for example, one of them, shown below, doesn't actually print anything:

    Code:
    /* New1.c */
    
    #include <stdio.h>
    
    int main(void)
    {
        printf("ABC\n");
        
        return 0;
    }
    This program compiles successfully, with no error nor warnings - however, when executed, nothing happens.

    Does anybody know what could be happening? Some hours ago I wrote and executed a program which used pointers to FILE - is it possible that it may be related to the problem? I even uninstalled and reinstalled the compiler, but the problem is still present.

    Thanks in advance!

  2. #2
    Ultraviolence Connoisseur
    Join Date
    Mar 2004
    Posts
    507
    I would guess either the program is running so fast you don't see anything happening (it will print to a dos window if anything, which will immediately close. You can easily check this by simply putting a getchar(); call after the printf() statement) OR your compiler is outputting to some "pane" or other hidden/tabbed window that you aren't viewing.

  3. #3
    Registered User
    Join Date
    Jan 2013
    Posts
    2
    put getch() function at the end of code

  4. #4
    Ultraviolence Connoisseur
    Join Date
    Mar 2004
    Posts
    507
    Quote Originally Posted by sunil pandey View Post
    put getch() function at the end of code
    getch() is non-standard and completely pointless for something as simple as halting execution pending user input.
    stahta01 likes this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Executing programs in your PATH
    By Sfel in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2008, 06:14 AM
  2. Please Help Me! Executing Problem
    By hattourie in forum C Programming
    Replies: 1
    Last Post: 11-05-2007, 04:04 AM
  3. Replies: 40
    Last Post: 09-01-2006, 01:09 AM
  4. Problem executing sample program:
    By mrabiu in forum C++ Programming
    Replies: 4
    Last Post: 03-13-2004, 06:44 PM
  5. executing c++ programs on the web
    By gulti01 in forum C++ Programming
    Replies: 4
    Last Post: 08-12-2002, 04:12 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21