P-A P-A - 1 year ago 69
C Question

How to run C/C++ in a Unix console/Mac terminal?

How can I run C or C++ in Unix console or a Mac terminal?

(I know it, forgets it and relearn it again. Time to write it down.)

Answer Source

If it is a simple single source program:

make foo

where the source file is foo.c or foo.cpp, etc.

You dont even need a makefile. Make has enough built-in rules to build your source file into an executable of the same name, minus extension.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download