Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. my first time programming

my first time programming

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jaapdeboer
    wrote on last edited by
    #1

    Hello, a while ago I planned on programming with c/c++. The problem was the compiler. Now I have one but when I make just a simple program like: "hello world" the DOS screen will apear for just very short. Then it closes itself. I was thinking maybe it was logical because you just tell him to show "hello world" and then it quits by itself. So I made a program were you had to put 2 numbers in variables. I entered 2 numbers and pressed ENTER and the same thing happens. Does anyone know how to solve this? Thomas

    M A C S 5 Replies Last reply
    0
    • J jaapdeboer

      Hello, a while ago I planned on programming with c/c++. The problem was the compiler. Now I have one but when I make just a simple program like: "hello world" the DOS screen will apear for just very short. Then it closes itself. I was thinking maybe it was logical because you just tell him to show "hello world" and then it quits by itself. So I made a program were you had to put 2 numbers in variables. I entered 2 numbers and pressed ENTER and the same thing happens. Does anyone know how to solve this? Thomas

      M Offline
      M Offline
      Mukkie
      wrote on last edited by
      #2

      Hello! Try to use getch() or _getch() at the end of the code. This application quits, becuase there is no loop. So either solution is to create a loop. :)

      1 Reply Last reply
      0
      • J jaapdeboer

        Hello, a while ago I planned on programming with c/c++. The problem was the compiler. Now I have one but when I make just a simple program like: "hello world" the DOS screen will apear for just very short. Then it closes itself. I was thinking maybe it was logical because you just tell him to show "hello world" and then it quits by itself. So I made a program were you had to put 2 numbers in variables. I entered 2 numbers and pressed ENTER and the same thing happens. Does anyone know how to solve this? Thomas

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Try using getch() after your final input

        1 Reply Last reply
        0
        • J jaapdeboer

          Hello, a while ago I planned on programming with c/c++. The problem was the compiler. Now I have one but when I make just a simple program like: "hello world" the DOS screen will apear for just very short. Then it closes itself. I was thinking maybe it was logical because you just tell him to show "hello world" and then it quits by itself. So I made a program were you had to put 2 numbers in variables. I entered 2 numbers and pressed ENTER and the same thing happens. Does anyone know how to solve this? Thomas

          C Offline
          C Offline
          Carlos Antollini
          wrote on last edited by
          #4

          it's not a problem... If you run your application from VC with Ctrl+F5 you will see the message, and then you must to press a button to close it. When you run your application for example in debug mode, the VC creates the console and close it when the app finish. If you like, you can run your app from command line, and you will see when the app finish the cursor returns to the prompt... Carlos Antollini Do you know piFive[^] ?

          1 Reply Last reply
          0
          • J jaapdeboer

            Hello, a while ago I planned on programming with c/c++. The problem was the compiler. Now I have one but when I make just a simple program like: "hello world" the DOS screen will apear for just very short. Then it closes itself. I was thinking maybe it was logical because you just tell him to show "hello world" and then it quits by itself. So I made a program were you had to put 2 numbers in variables. I entered 2 numbers and pressed ENTER and the same thing happens. Does anyone know how to solve this? Thomas

            S Offline
            S Offline
            Snyp
            wrote on last edited by
            #5

            I like to use this (at the very end of your program, before the return of the main function): system("pause"); Actual Linux Penguins were harmed in the creation of this message.

            1 Reply Last reply
            0
            • J jaapdeboer

              Hello, a while ago I planned on programming with c/c++. The problem was the compiler. Now I have one but when I make just a simple program like: "hello world" the DOS screen will apear for just very short. Then it closes itself. I was thinking maybe it was logical because you just tell him to show "hello world" and then it quits by itself. So I made a program were you had to put 2 numbers in variables. I entered 2 numbers and pressed ENTER and the same thing happens. Does anyone know how to solve this? Thomas

              A Offline
              A Offline
              Anonymous
              wrote on last edited by
              #6

              or you can add a cin>> at the end like I do :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups