Stupid Question but stumped.

Discussion in 'Web Design & Coding' started by Heineken Man, Aug 5, 2002.

  1. Heineken Man

    Heineken Man Guest

    Ok I know this is a stupid question but I am not sure how to correct this. Ok I am reading a book on "C" and it starts with some simple codes that open up a dos window and display some text. Well the question is how the hell do I keep the dos window open. As far as I can tell all my scripts work but it flashes so quick that I can hardly get a glance. It is begining to annoy me. Anyone know how to stop dos from closing after it runs the script?

    Thanks for all that reply,
    Heineken Man
  2. obi-wan

    obi-wan Guest

    Try to read a value from i/o at th end of your code ( getch(), scanf(...) ) MSDN for more information about these funcion.
  3. Kw4ntuM

    Kw4ntuM Guest

    try this(works in java, which is much the same)

    make sure u initialized the input stream thingy(IStream in java)

    then add to the end before closing the brackets 'Input.pause();'

    that will leave the window open until u hit return

    or put in while(true){}

    which will leave the window open until it is closed manually
  4. xsk8zerox

    xsk8zerox Moderator

    add pause at the end (?)
  5. Khayman

    Khayman I'm sorry Hal... Political User Folding Team

    you need to run the programs from a dos window not from "run" or the built in run

    i.e go to start->run and type cmd

    then change to your directory and run the program

    I will look into keeping a command window open (it is a windows thing not your program)
  6. what he said