Easy C In Ubuntu

C Program Creation Explained Simply And Quickly.

Remember % is the Unix system prompt. Ubuntu’s system prompt is different. Linux is different than Unix in running a compiled C program. One must place a ./programname in order for the program to run in Linux.

From http://courses.cms.caltech.edu/cs11/material/c/mike/lectures/C_lecture_1.pdf

  1. Go to terminal.
  2. In your home directory make a directory called ctests (mkdir ctests).
  3. Go to ctests directory. (cd ctests)
  4. Make hello.c text file. (sudo nano hello.c)
  5. Add hello world text. (Find it at Slide 7 http://courses.cms.caltech.edu/cs11/material/c/mike/lectures/C_lecture_1.pdf)
  6. Save file and compile it (Find it at Slide 8 http://courses.cms.caltech.edu/cs11/material/c/mike/lectures/C_lecture_1.pdf)
  7. Run the compiled program by typing ./hello



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: