# C programming question

**URL:** <https://boards.straightdope.com/t/c-programming-question/153642>\
**Category:** Factual Questions\
**Created:** [February 8, 2003, 3:21am UTC](https://boards.straightdope.com/t/c-programming-question/153642 "2003-02-08T03:21:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cw](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cw](https://boards.straightdope.com/u/cw)\
**Post date:** [February 8, 2003, 3:21am UTC](https://boards.straightdope.com/t/c-programming-question/153642/1 "2003-02-08T03:21:11Z")

</div>

How do you compile and run a C program from the DOS prompt? C not C++ (if that even matters)?

---

<div class="post-metadata">

**Author:** ![Fuji\_Kitakyusho](https://avatars.discourse-cdn.com/v4/letter/f/f0a364/32.png) [@Fuji\_Kitakyusho](https://boards.straightdope.com/u/Fuji_Kitakyusho)\
**Post date:** [February 8, 2003, 3:29am UTC](https://boards.straightdope.com/t/c-programming-question/153642/2 "2003-02-08T03:29:33Z")

</div>

A C/C++ compiler, as far as I am aware, is not included with DOS or any other OS I am aware of. You need a compiler to interpret the C code and convert it to the machine instructions in an .EXE file. You can download the freeware GNU C/C++ compiler from the internet, or purchase a development environment such as Borland or Microsoft Visual C++.

---

<div class="post-metadata">

**Author:** ![II\_Gyan\_II](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@II\_Gyan\_II](https://boards.straightdope.com/u/II_Gyan_II)\
**Post date:** [February 8, 2003, 3:32am UTC](https://boards.straightdope.com/t/c-programming-question/153642/3 "2003-02-08T03:32:22Z")

</div>

> [@](#):
>
> \*Originally posted by cw \*  
> \*\*How do you compile and run a C program from the DOS prompt? C not C++ (if that even matters)? \*\*

For a minute there, you had me confused. I thought some posts had been lost. But then you posted this very [question](http://boards.straightdope.com/sdmb/showthread.php?s=&threadid=161611) 40 minutes before this one. Check your replies there.

---

<div class="post-metadata">

**Author:** ![cw](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cw](https://boards.straightdope.com/u/cw)\
**Post date:** [February 8, 2003, 3:38am UTC](https://boards.straightdope.com/t/c-programming-question/153642/4 "2003-02-08T03:38:24Z")

</div>

Sorry I was having problems adding my post, seemed the server (or me) was running very slow. Sorry for the double post.

---

<div class="post-metadata">

**Author:** ![Some\_Guy](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Some\_Guy](https://boards.straightdope.com/u/Some_Guy)\
**Post date:** [February 8, 2003, 3:38am UTC](https://boards.straightdope.com/t/c-programming-question/153642/5 "2003-02-08T03:38:33Z")

</div>

Any POSIX-compliant Unix-like OS will include a C compiler, in most cases GCC. Also, because C++ is a superset of C, nearly all C compilers these days will also compile C++ . If you need a compiler for Microsoft OSes, the usual recommendation is [DJGPP](http://www.delorie.com/djgpp/), which is based in part on a port of GCC. Please note that I have not used this, and so cannot atest to its usefulness, or lack thereof.

---

<div class="post-metadata">

**Author:** ![John\_Kentzel-Griffin](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@John\_Kentzel-Griffin](https://boards.straightdope.com/u/John_Kentzel-Griffin)\
**Post date:** [February 8, 2003, 4:16am UTC](https://boards.straightdope.com/t/c-programming-question/153642/6 "2003-02-08T04:16:08Z")

</div>

Duplicate thread.

I’ll close this and direct posters to reply to [C programming question](http://boards.straightdope.com/sdmb/showthread.php?s=&threadid=161611).

**DrMatrix** - General Questions Moderator
