+ Reply to Thread
Results 1 to 8 of 8

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

  1. #1
    Newbie proeliumfessus is an unknown quantity at this point proeliumfessus's Avatar
    Join Date
    May 2009
    Posts
    19

    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. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

    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.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    Newbie proeliumfessus is an unknown quantity at this point proeliumfessus's Avatar
    Join Date
    May 2009
    Posts
    19

    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.

  4. #4
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

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

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

  5. #5
    Newbie proeliumfessus is an unknown quantity at this point proeliumfessus's Avatar
    Join Date
    May 2009
    Posts
    19

    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?

  6. #6
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

    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.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #7
    Learning Programmer killcode is an unknown quantity at this point killcode's Avatar
    Join Date
    Feb 2009
    Location
    United kingdom, SE london
    Posts
    90

    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

  8. #8
    Guru nicckk has a spectacular aura about nicckk has a spectacular aura about nicckk's Avatar
    Join Date
    Oct 2008
    Location
    San Diego
    Posts
    571

    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)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. How to ask a question!
    By Donovan in forum C and C++
    Replies: 7
    Last Post: 01-08-2009, 05:51 AM
  2. C/C++ FAQ: Read this before you post!
    By v0id in forum C and C++
    Replies: 7
    Last Post: 08-05-2008, 12:08 PM
  3. Replies: 6
    Last Post: 05-23-2008, 10:00 AM
  4. n00b class question
    By MerakSpielman in forum C and C++
    Replies: 15
    Last Post: 02-20-2008, 10:37 PM
  5. C++ Compiler question
    By skilletsteve in forum C and C++
    Replies: 4
    Last Post: 09-28-2006, 07:39 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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