Thread: Borland Compiler

  1. #1
    Andrew Arii
    Guest

    Borland Compiler

    I am a beginner student of the C language and I recieved the Borland Complier with my textbook. I went to test out the program and wrote a simple printf statement with no errors. When I went to run the program, a black screen popped up and disappeared. I wrote another simple program to convert miles to kilometers. This time, the black screen stayed and asked me to input the miles to be converted as I had programmed it to. When I entered a number and pressed return, the screen disapeared again. I can't get the screen to stay up after I run my programs and it is beginning to frustrate me. The only compiler I have had any success with is the one I use at school which is very primitive and different than the Borland compiler. I don't know what I'm doing wrong or how to fix my problem. I'm sorry I'm a novice, but we all start somewhere. Thank you for you time and your patience.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Isn't this in the faq come place? What's happening has nothing to do with your compiler. It has to do with (a) your program, and (b) the OS.

    I'll assume you're using Windows. As such, it's simply closing the console window once it is done. Run your program from the command line, or add something like:
    Code:
    int main ( void )
    {
        /* your code here */
    
    
        printf("My program is done. Hit enter to exit.");
        getchar( );
        return 0;
    }
    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Andrew Arii
    Guest

    It worked.

    Just wanted to say thanks for your help. It worked and now I'm on my way. You're a genius compared to me. Thanks again.

  4. #4
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001

    Re: It worked.

    Originally posted by Andrew Arii
    Just wanted to say thanks for your help. It worked and now I'm on my way. You're a genius compared to me. Thanks again.
    You're in for a surprise, there's some people on here who are good enough to use void main() instead of int....now THERE are some geniuses....just blows my mind sometimes.
    PHP and XML
    Let's talk about SAX

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    2

    More yet.

    Ok, I'm the same guy from before, I only registered on this forum. I did what you told me to do, and it worked...once. Now, a gray screen comes up and stays up. Nothing else happens. And about the faqs, I looked there and I didn't recognize anything that resembled my problem. Any help would be appreciated.

  6. #6
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Post your code.

  7. #7
    Registered User
    Join Date
    Jan 2003
    Posts
    2

    Don't worry about it.

    This is proving to be more of a pain than it needs to be. I talked to a few other students and my teacher. None of them like the Borland compiler. I know it's not a problem with the code because I already got it to work on the compiler at school which is old enough to be an antique, probably. I guess I'm just not familiar with the Borland one. My codes are either very elementary or practice from my textbook, anyway. Like I said before, I'm a beginner and I mean that in every sense of the word. The first time I used a compiler was about a week ago, if that says anything to you. So I think I'm going to to try and find a compiler my friend was talking about. I think it's called codewarrior, or something like that. He explained a bit of it to me and soumds pretty easy to use. I just need something to practice on to improve what I learn. If you have any other helpful suggestions or tips, I'd love to hear them.

  8. #8
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>Now, a gray screen comes up and stays up.
    Don't know what that is, but let me suggest the following:

    - Write you code and compile it in the editor.
    - Get to a console prompt (Start->Run->command (or cmd for NT/XP)
    - CD your way to the directory where your .exe file is
    - Type the name of your .exe to run it.

    This way, you shouldn't have any "disappearing window" problems.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed