2008SpCS61C-L03-ddg-c1

2008SpCS61C-L03-ddg-c1 - inst.eecs.berkeley.edu/~cs61c...

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

View Full Document Right Arrow Icon
CS61C L03 Introduction to C (pt 1) (1) Garcia, Spring 2008 © UCB Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 3 – Introduction to the C Programming Language (pt 1) 2008-01-28 Hello to Dev Anand from Pune, Maharashtra, INDIA Infected Frames! Malware has been found in photo frames recently sold by Best Buy. This is not the first time this has happened in personal electronics (iPods, drives, MP3 players). Be careful! www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2008/01/26/MNE7UHOOQ.DTL
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS61C L03 Introduction to C (pt 1) (2) Garcia, Spring 2008 © UCB Number review. .. We represent “things” in computers as particular bit patterns: N bits 2 N Decimal for human calculations, binary for computers, hex to write binary more easily 1’s complement - mostly abandoned 2’s complement universal in computing: cannot avoid, so learn 00000 00001 01111 ... 11111 11110 10000 . .. 00000 00001 01111 ... 11111 11110 10000 . .. META: We often make design decisions to make HW simple
Background image of page 2
CS61C L03 Introduction to C (pt 1) (3) Garcia, Spring 2008 © UCB Introduction to 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
CS61C L03 Introduction to C (pt 1) (4) Garcia, Spring 2008 © UCB Has there been an update to ANSI C? Yes! It’s called the “C99” or “C9x” std You need “ gcc -std=c99 ” to compile References http://en.wikipedia.org/wiki/C99 http://home.tiscalinet.ch/t_wolf/tw/c/c9x_changes.html Highlights Declarations anywhere, like Java (#15) Java-like // comments (to end of line) (#10) Variable-length non-global arrays (#33) <inttypes.h> : explicit integer types (#38) <stdbool.h> for boolean logic def’s (#35) restrict keyword for optimizations (#30)
Background image of page 4
CS61C L03 Introduction to C (pt 1) (5) Garcia, Spring 2008 © UCB Disclaimer Important : You will not learn how to fully code in C in these lectures! You’ll still need your C reference for this course. Check online for more sources “JAVA in a Nutshell,” O’Reilly. Chapter 2, “How Java Differs from C” Brian Harvey’s course notes On class website
Background image of page 5

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

View Full DocumentRight Arrow Icon
CS61C L03 Introduction to C (pt 1) (6) Garcia, Spring 2008 © UCB Compilation : Overview C compilers take C and convert it into an architecture specific machine code (string of 1s and 0s). Unlike Java which converts to architecture independent bytecode. Unlike most Scheme environments which interpret the code. These differ mainly in
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 29

2008SpCS61C-L03-ddg-c1 - inst.eecs.berkeley.edu/~cs61c...

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

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