Menu

New to Dev-C++

Gilyse
2007-11-01
2012-09-26
  • Gilyse

    Gilyse - 2007-11-01

    Hey, I use the Dev-C++ 4.9.9.2.

    I am trying to make the "Hello World" program work. every time I compile it when I try to run it a window pops of for a split second then disapears. The dev-c++ doesn't say there are any errors or anything else for that matter.

    How do i get the program to run?

     
    • j_a_lvl_e_s

      j_a_lvl_e_s - 2007-11-22

      // hello world!

      include <iostream>

      using namespace std;

      int main()
      {
      cout<<"Hello World\n";

      cin.get();
      return 0;
      }

      This should work I think.

       
      • Anonymous

        Anonymous - 2007-11-22

        Two weeks on from the last post tt this thread, you can be sure that this simple and frequently asked question has been answered or that the OP has moved on!

         
    • Gilyse

      Gilyse - 2007-11-01

      PS: I have Windows XP

       
      • Wayne Keen

        Wayne Keen - 2007-11-01

        Please make it a habit to look around a forum before posting a question.
        Had you done that, you would have seen a thread in this forum titled
        "PLEASE READ BEFORE POSTING A QUESTION" - yep, it is in all capitals -
        and, you would have found your question is answered there already.

        Wayne

         
    • Gilyse

      Gilyse - 2007-11-01

      Thanks Wayne. I read that first but only for the 3 basic questions to be answered part. Although what was wrong with my script? i copied it right out of the help on dev-c++ tutorial:

      include <stdio.h>

      int main()
      {
      printf("Hello World\n");
      return 0;
      }

      It looks nothing like what you put.

       
    • Wayne Keen

      Wayne Keen - 2007-11-01

      Why are you asking the same question again?

      As I said earlier it is answered directly in the thread I pointed you to.

      You will have to read past the first section that you stopped at before - but your EXACT question is answered there.

      When you read it, you will see what is missing from your code.

      The 'help' file is a long abandoned POS - don't bother with it. You can find a world of more useful information in the Please Read thread.

      Wayne

       
      • Wayne Keen

        Wayne Keen - 2007-11-01

        A further point of reference. Most of what goes on when you program is not magic - despite the impression we sometime try to give.

        In this case, the process is really simple, when you think about it. Your program does what you tell it to do - and then it finishes. You gave the computer no direction as to what to do then, so it closed up shop and quit.

        To get around this, you have to keep the program from finishing. The method I pointed you to - the use of 'pause' is one such way. You could also do the same thing with an input statement.

        Programming is like giving directions to a young child - if you don't tell it everything, things may happen you do not expect.

        Wayne

         
    • Anonymous

      Anonymous - 2007-11-01

      >> How do i get the program to run?

      You did. It ran to completion. Upon completion the OS closes an applications window. This only ever seems to surprise people when they write their own code! ;-) Exactly the kind of people you would hope knew what was going on.

      Had you read the "PLEASE READ BEFORE POSTING A QUESTION" you'd see that this is addresses there. YOu seem to have an alternative definition for "BEFORE".

      Another way of getting it to work is to use "Hello World" project template which incorporates the solution proposed in the above: File->New->New project->Introductory.

      Clifford

       
    • Anonymous

      Anonymous - 2007-11-01

      >> ...but only for the 3 basic questions to be answered part.

      And yet you still never provided that information!

      >> i copied it right out of the help on dev-c++ tutorial

      I would not bother with that tutorial, it is old and badly written and only applies to C not C++ code.

      Clifford

       
    • Yahya

      Yahya - 2007-11-05

      Just Include the " getchar(); , as it is appears down

      include <stdio.h>

      int main()
      {
      printf("Hello World\n");
      getchar();
      return 0;
      }

       
      • Anonymous

        Anonymous - 2007-11-05

        That way lies madness!

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.