How to RUN C by Microsoft Visual Studio

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    How to RUN C by Microsoft Visual Studio

    Hi

    I would like to use microsoft visual studio to compile a C program.
    Does somebody know how to compile, link and run it?
    I create a project and add a program to it.
    I press F5 to start debug (because I cannot find any command to run,
    why?).
    A console window just appears and close very quickly.
    How can I pause the console window?

    Mike
  • Ian Collins

    #2
    Re: How to RUN C by Microsoft Visual Studio

    Mike wrote:
    Hi
    >
    I would like to use microsoft visual studio to compile a C program.
    Does somebody know how to compile, link and run it?
    That somebody will be reading one of the visual studio groups!

    --
    Ian Collins.

    Comment

    • Mike

      #3
      Re: How to RUN C by Microsoft Visual Studio

      On 2$B7n(B27$BF |(B, $B2<8a(B2$B; ~(B32$BJ,(B, Ian Collins <ian-n...@hotmail.co mwrote:
      Mike wrote:
      Hi
      >
      I would like to use microsoft visual studio to compile a C program.
      Does somebody know how to compile, link and run it?
      >
      That somebody will be reading one of the visual studio groups!
      >
      --
      Ian Collins.
      thank you for your reply.

      Mike

      Comment

      • Kenneth Brody

        #4
        Re: How to RUN C by Microsoft Visual Studio

        Mike wrote:
        >
        Hi
        >
        I would like to use microsoft visual studio to compile a C program.
        Does somebody know how to compile, link and run it?
        I create a project and add a program to it.
        I press F5 to start debug (because I cannot find any command to run,
        why?).
        <OT>
        Ctrl-F5. It's right there in the "build" menu. I can't answer "why"
        you cannot find it.
        </OT>
        A console window just appears and close very quickly.
        How can I pause the console window?
        Dunno. My programs always pause after running, if run with the IDE.
        You'll need to ask in one of the Microsoft-related newsgroups why yours
        doesn't.

        --
        +-------------------------+--------------------+-----------------------+
        | Kenneth J. Brody | www.hvcomputer.com | #include |
        | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer .h|
        +-------------------------+--------------------+-----------------------+
        Don't e-mail me at: <mailto:ThisIsA SpamTrap@gmail. com>


        Comment

        • Malcolm McLean

          #5
          Re: How to RUN C by Microsoft Visual Studio


          "Mike" <SulfateIon@gma il.comwrote in message
          news:915d0c78-6ef4-4abc-923b-d0333b73edf1@s1 9g2000prg.googl egroups.com...
          Hi
          >
          I would like to use microsoft visual studio to compile a C program.
          Does somebody know how to compile, link and run it?
          I create a project and add a program to it.
          I press F5 to start debug (because I cannot find any command to run,
          why?).
          >
          You'd have to ask Microsoft that one. The IDE is rather fiddly to use,
          though quite powerful when you get used to it.
          >
          A console window just appears and close very quickly.
          How can I pause the console window?
          >
          Call getchar() before your program exits. This forces it to read input from
          stdin, or keyboard.

          --
          Free games and programming goodies.



          Comment

          • pete

            #6
            Re: How to RUN C by Microsoft Visual Studio

            Mike wrote:
            >
            Hi
            >
            I would like to use microsoft visual studio to compile a C program.
            Does somebody know how to compile,
            Ctrl F7
            link
            F7
            and run it?
            I create a project and add a program to it.
            I press F5 to start debug
            (because I cannot find any command to run, why?).
            A console window just appears and close very quickly.
            How can I pause the console window?
            Don't run the program from the MSVC console window.
            Open another window from outside of MSVC,
            and cd (change directory) to where the executable files wind up,
            amd run your programs from there.

            --
            pete

            Comment

            • Richard Heathfield

              #7
              Re: How to RUN C by Microsoft Visual Studio

              pete said:
              Mike wrote:
              >>
              >Hi
              >>
              >I would like to use microsoft visual studio to compile a C program.
              >Does somebody know how to compile,
              >
              Ctrl F7
              >
              >link
              >
              F7
              Well, I'm not about to fire up a Windows machine to check, but ISTR that
              the exact keypresses may depend on which keyboard bindings you selected
              when you installed VS. The reason I use weasel words like "may" is that I
              may be disremembering - it may only be the editor itself to which these
              choices apply.
              >
              >and run it?
              >I create a project and add a program to it.
              >I press F5 to start debug
              >(because I cannot find any command to run, why?).
              >A console window just appears and close very quickly.
              >How can I pause the console window?
              >
              Don't run the program from the MSVC console window.
              Good advice, but there is an alternative: Ctrl-F5 (or whatever), which runs
              the program outside the debugger and displays the legend "Press any key to
              continue" (or some trivial variant thereof) when the program terminates.
              Open another window from outside of MSVC,
              A console window, that is. In modern Windowses, this can be done by
              pressing Windows-R and entering the command

              cmd

              In older Windowses, the command is

              command
              and cd (change directory) to where the executable files wind up,
              amd run your programs from there.
              Right. Note that the executable files tend to be created in subdirectories
              of the development directory, with the default names "debug" or "release",
              depending on whether you're building a debug version or a release version.

              Might I suggest that any further discussion of this stuff more properly
              belongs in comp.os.ms-windows.program mer.win32 or one of the Microsoft
              groups?

              --
              Richard Heathfield <http://www.cpax.org.uk >
              Email: -http://www. +rjh@
              Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
              "Usenet is a strange place" - dmr 29 July 1999

              Comment

              Working...