lecture16-feb26 - Announcements - Lecture 16 Assignment 3...

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

View Full Document Right Arrow Icon
1 Announcements - Lecture 16 • Assignment 3 – write down your stats – SLOCs, hours, logic defects – Lessons: start sooner, expect problems • Assignment 4 out Monday – Designs due next recitation (not today) • Read rest of Ch. 22 for next week • Topics for today – Introduction to pointers (Ch. 11) • A very difficult subject for many “pointers are one of C’s most important – and most often misunderstood – features” Pointers 101 • Important and difficult subject in C • Memory addresses and pointer variables Address of and indirection (contents at) operators • Pointer assignment • Pointer arithmetic • Pointers and arrays • Passing pointers to/from functions (time permitting) Your Computer’s RAM 01011100 01011100 01011100 01011100 00000001 00101111 Contents 0) 1) 2) 3) . . . Address Memory is organized into a sequence of “bytes” and words - each byte has it’s own memory address and contains an 8-bit pattern RAM = random access memory Remember that a variable name is actually just a symbolic name for a memory address int x; A pointer is a memory address A pointer variable holds a memory address Assignment revisited • For example: int x; x = 17; lvalue = rvalue; rvalue : is an expression that evaluates to a value lvalue : is an expression that evaluates to a memory address (usually its just a variable name, but could be an expression) • The assignment operator stores the rvalue into the location identified by the memory address ( lvalue ) for the type of data declared (a STORE operation in AL) Why do we need pointers? • Power of direct manipulation of memory locations
Background image of page 1

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

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

This note was uploaded on 03/15/2010 for the course EE 16005 taught by Professor Krasner during the Spring '10 term at University of Texas.

Page1 / 3

lecture16-feb26 - Announcements - Lecture 16 Assignment 3...

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

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