week4 - Unix C GNU HTML Perl Python C Compilation Model and...

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

View Full Document Right Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 1 C Compilation Model and Basic Syntax Comp-206 : Introduction to Software Systems Week 4 Joseph Vybihal Computer Science McGill University
Background image of page 1

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

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 2 Announcements C tutorials soon Ass#1 due Ass#2 out tonight
Background image of page 2
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 3 Part 1 About C
Background image of page 3

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

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 4 History of C The C programming language was created as a successor for B and BCPL (Basic Combined Programming Language) . It’s creation was parallel to the development of early Unix operating systems (1969-1973). At the time, one of C’s strength was it’s portability. The first widely available description of the language appeared in 1978,The C Programming Language (also known as the little white book). One of C’s most popular successor is C++, released in 1986.
Background image of page 4
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 5 Programming in C From the user's perspective, building a C program can be broken down in three steps: Writing the program (or source code) Compiling the program Running the program (or executable)
Background image of page 5

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

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 6 Programming in C Writing the source : Using an editor to write the source. You can use any text editor to write C code. Old-school C programmer often use Unix text editors such as Vi or Vim. For large scale projects, an IDE (integrated development environment) is preferable. Whatever editor you use, it should feature syntax highlighting C programs are usually composed of several source files (we will take a look at this latter).
Background image of page 6
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 7 Programming in C (cont.) The next step is to compile the program to a format the operating system can run. A compiler is a program that translates one language to another. A C compiler translates C code to machine code. A Java compiler translates Java code to byte code. For this course, we will use the GNU compiler (also known as gcc ). This compiler is installed on all the lab machines and servers.
Background image of page 7

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

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 Software Systems 8 Programming in C (cont.) By default, the gcc compiler produces an executable file named a.out . On Windows it is name.exe . ( name = anything) You can execute your program by running the a.out file. Don’t forget that a.out must be chmod to executable . The compiler usually takes care of this. In windows you do not need to do this, it is automatic.
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/05/2009.

Page1 / 73

week4 - Unix C GNU HTML Perl Python C Compilation Model and...

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

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