LEC20080905 - Introduction to Computer Programming...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction to Computer Programming September 5, 2008 1 The ECF machine After logging into an ecf machine, find the icon called Terminal. Figure 1: Terminal icon Clicking Terminal icon, we will have a Terminal window (Figure 2), in which we can do almost anything related to C programming. [lanhui@p27 ~] $ is system prompt. emacs -nw opens the text editor emacs with no window, 1 where-nw is an option for emacs, meaning no window. hello.c is the C source file we want to create. Figure 2: Terminal window After hitting Enter key, we enter the interface of emacs (Figure 3), where we can edit our C source file hello.c . The contents of hello.c are listed below. We save hello.c and return to our Terminal window. #include <stdio.h> int main() { printf(Hello, world\n); return 0; } We type the command gcc hello.c to compile hello.c , where gcc is our C compiler (Figure 4). Roughly speaking, compilation is a process in which the C source file is converted to a binary file, also called executable. In default,C source file is converted to a binary file, also called executable....
View Full Document

Page1 / 7

LEC20080905 - Introduction to Computer Programming...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online