Closed Thread
Results 1 to 8 of 8

Thread: quickie question for anyone- using Dev-C++ compiler..

  1. #1
    Join Date
    May 2009
    Posts
    19
    Rep Power
    0

    Arrow quickie question for anyone- using Dev-C++ compiler..

    using the dev-c++ compiler by bloodshed- (I'm new to programming) when I code a basic hello world program and click compile it compiles but there's no window that pops up and displays the output with "hello world" in it? So I thought I should click the "run" button and it seemed to bring up a small "output looking" window, but only for a split second.. then it disappears... it doesnt stay long enough for me to notice the words "hello world"... does anyone know how I get this window to stay instead of disappearing?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: quickie question for anyone- using Dev-C++ compiler..

    You can select Start: Run: "cmd", then run the program from the command line. Alternatively, you can use cin to get input.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    Join Date
    May 2009
    Posts
    19
    Rep Power
    0

    Re: quickie question for anyone- using Dev-C++ compiler..

    thanks wingedpanther- that's twice you've tried to assist- appreciate it But unfortunately, when I run it from the command line the behavior is the exact same- the window just briefly flashes... apparently it's supposed to disappear and I just havnt learned why yet.. on a side note when I set out to learn c++ I was prepared to be challenged learning the language... I had absolutely no idea the compilers them selves would be such a challenge too. oh well. suck it up, right lol.

  5. #4
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: quickie question for anyone- using Dev-C++ compiler..

    No. You have to actually launch the program from the command prompt.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    Join Date
    May 2009
    Posts
    19
    Rep Power
    0

    Re: quickie question for anyone- using Dev-C++ compiler..

    that means I have to know the basics of dos right? if I understand you, you're saying I have to basically somehow get "c:\" to show up in the window- then type out the path to the .exe, then hit enter to run it? is that what you wanted me to do?

    I typed "cmd" in the run box.. it brought up what I think is the comand prompt window.... the default directory was "c:\documents and settings \administrator>

    so after the ">" I typed the name of the .exe (because it's in the documents and settings directory).. it said in return: "untitled.exe" is not recognized as an internal or external command... I guess it's a syntax error?

  7. #6
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: quickie question for anyone- using Dev-C++ compiler..

    You're right, but you have to be in the folder where the .exe is located. You can type "dir" to get a list of files, and "cd" to change directories. "cd.." goes to the parent, "cd [folder]" goes into the folder.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  8. #7
    killcode's Avatar
    killcode is offline Learning Programmer
    Join Date
    Feb 2009
    Location
    United kingdom, SE london
    Posts
    96
    Rep Power
    0

    Re: quickie question for anyone- using Dev-C++ compiler..

    If your on windows, you could just simply add

    Code:
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    int main()
     {
        cout << "Hello World" << endl;
        system("pause");
        return 0;
     }
    this would allow you to use the windows command called "pause" which you can see is system("pause");

    and now it would pause the prompt without exiting....

    note: #include <windows.h> allows you to have acces to the windows functions

  9. #8
    Join Date
    Oct 2008
    Location
    San Diego
    Posts
    629
    Rep Power
    19

    Re: quickie question for anyone- using Dev-C++ compiler..

    Killcode got the right idea. if you tried WP's way to run it through the command prompt you would need to follow these steps.

    Compile the program
    Open CMD
    Go to the directory its located in, (eg. cd C:\\Users\Nick\Desktop\program.exe)

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What is your fav compiler ?
    By genux in forum C and C++
    Replies: 9
    Last Post: 04-14-2010, 10:52 AM
  2. C# Compiler - Daft question.
    By G_Morgan in forum C# Programming
    Replies: 9
    Last Post: 07-02-2009, 12:24 PM
  3. Replies: 6
    Last Post: 05-23-2008, 08:00 AM
  4. Best C/C++ Compiler?
    By bbalegere in forum C and C++
    Replies: 9
    Last Post: 02-27-2007, 01:29 PM
  5. C++ Compiler question
    By skilletsteve in forum C and C++
    Replies: 4
    Last Post: 09-28-2006, 05:39 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts