Link to home
Start Free TrialLog in
Avatar of naturalmystic
naturalmystic

asked on

writing a c programme in a unix environment

I just  started programming in C and  I need to  write a  C   programme
in  Unix.   How do I start?
Avatar of shchuka
shchuka

You should use any text editor to write the source code, e.g. vi, emacs, pico, or anything else.  I personally recommend emacs.  If you're working on a workstation, it has C syntax coloring and it will automatically match parenthes (all kinds: (), [], {}). Start it by typing at the command prompt:
    emacs filename.c
After you've created the file, compile it using gcc or cc or whatever compiler is available on your system:
    gcc -o outputfilename filename.c

This is the simplest thing you would do.  Of course, if you're working on a large project, you'll have a make file to compile the sources and also you'll probably use some flags to pass to the compiler.  From you question, I believe you are just starting working with C, so my answer should be enough to get you started.
ASKER CERTIFIED SOLUTION
Avatar of kellyjj
kellyjj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of naturalmystic

ASKER

Thanks kellyjj for attempting an answer but I found schuka's comment more helpful.THANKS  A LOT SCHUKA.WHAT BOOKS ARE YOU TALKING  ABOUT KELLYJJ?