locked
how to run C programs?

    Question

  • Using Microsoft Visual C# 2010 Express, how to run C programs for the following? 

    1. From the IDE

    2. From command line?

    Monday, August 23, 2010 12:46 PM

Answers

  • >Using Microsoft Visual C# 2010 Express, how to run C programs

    Are you *really* using Visual CSharp? If so, what
    *exactly* are you trying to do? Execute a C program
    that has already been built? Compile/build/run from
    C source code?

    You will need to use VC++ to build C programs.

    >From the IDE

    Debug->Start Debugging (or F5)
    Debug->Start Without Debugging (or Ctrl-F5)

    Or on the toolbar, click on the Start Debugging icon (looks
    like a big right-arrow).

    >From command line?

    As you would any program.

    - Wayne
    Monday, August 23, 2010 6:52 PM
  • You would run C program EXEs from the IDE the same way as any other using the run arrows on the toolbar or from the Debug menu.

    If you are running from the shell you would just double click on the EXE in Explorer.

    If you have a CMD window open you'll be best off changing to the directory where the program exists and just running it in the old DOS way by typing in the name and pressing Enter.

    If you're trying to start them programmatically from a C# program you could use:

    http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx

    Tom

    Monday, August 23, 2010 9:54 PM

All replies

  • >Using Microsoft Visual C# 2010 Express, how to run C programs

    Are you *really* using Visual CSharp? If so, what
    *exactly* are you trying to do? Execute a C program
    that has already been built? Compile/build/run from
    C source code?

    You will need to use VC++ to build C programs.

    >From the IDE

    Debug->Start Debugging (or F5)
    Debug->Start Without Debugging (or Ctrl-F5)

    Or on the toolbar, click on the Start Debugging icon (looks
    like a big right-arrow).

    >From command line?

    As you would any program.

    - Wayne
    Monday, August 23, 2010 6:52 PM
  • You would run C program EXEs from the IDE the same way as any other using the run arrows on the toolbar or from the Debug menu.

    If you are running from the shell you would just double click on the EXE in Explorer.

    If you have a CMD window open you'll be best off changing to the directory where the program exists and just running it in the old DOS way by typing in the name and pressing Enter.

    If you're trying to start them programmatically from a C# program you could use:

    http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx

    Tom

    Monday, August 23, 2010 9:54 PM