2_Intro_to_C

2_Intro_to_C - INTRODUCTION TO PROGRAMMING IN C 1 CMPE13...

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

View Full Document Right Arrow Icon
CMPE13 Cyrus Bazeghi I NTRODUCTION TO P ROGRAMMING IN C 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
CMPE13 T HE C LANGUAGE - HISTORY Late „60s: MIT, GE, and Bell Labs partner up to build MULTICS, to provide computational power on a grid, just like electrical power, using the B programming language Early ‟70s: from B, Dennis Ritchie develops C , used by Ken Thompson to rewrite UNIX (at Bell Labs) “The white book” by Brian Kernighan and Dennis Ritchie: 2
Background image of page 2
CMPE13 C: A H IGH -L EVEL L ANGUAGE Gives symbolic names to values don‟t need to know which register or memory location Provides abstraction of underlying hardware operations do not depend on instruction set example: can write “a = b * c”, even though underlying hardware may not have a multiply instruction 3 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
CMPE13 C: A H IGH -L EVEL L ANGUAGE Provides expressiveness use meaningful symbols that convey meaning simple expressions for common control patterns (if-then- else) Enhances code readability Safeguards against bugs can enforce rules or conditions at compile-time or run-time 4 4
Background image of page 4
CMPE13 C OMPILATION VS . I NTERPRETATION Different ways of translating high-level language Interpretation interpreter = program that executes program statements generally one line/command at a time limited processing easy to debug, make changes, view intermediate results languages: BASIC, LISP, Perl, Java, Matlab, C-shell 5 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
CMPE13 C OMPILATION VS . I NTERPRETATION Compilation translates statements into machine language does not execute, but creates executable program performs optimization over multiple statements change requires recompilation can be harder to debug, since executed code may be different languages: C, C++, Fortran, Pascal 6 6
Background image of page 6
CMPE13 C OMPILATION VS . I NTERPRETATION Consider the following algorithm: Get W from the keyboard. X = W + W
Background image of page 7

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

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

This document was uploaded on 08/23/2010.

Page1 / 24

2_Intro_to_C - INTRODUCTION TO PROGRAMMING IN C 1 CMPE13...

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

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