Lecture07 - Last time Introduction to Low-Level Programming Concepts CMSC 212 Lecture 7 Chapter 10 Structures and unions pointers to structures

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

View Full Document Right Arrow Icon
Introduction to Low-Level Programming Concepts CMSC 212 ecture 7 1 CMSC 212 Lecture 7 September 22, 2009 Last time Chapter 10, Structures and unions – pointers to structures – passing pointers to structures as parameters – unions Chapter 5, Operators and expressions ssignment and the compound assignment operators 2 CMSC 212 – assignment and the compound assignment operators – unary operators – the relational, equality, and logical operators Reading Read Chapter 6 in Reek (Pointers on C) 3 CMSC 212 Chapter 5, Operators and Expressions, con't. 4 CMSC 212
Background image of page 1

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

View Full DocumentRight Arrow Icon
Other operators The ternary conditional operator has the form expr 1 ? expr 2 : expr 3 – if expr 1 is nonzero, expr 2 is evaluated and is the result – if expr 1 is zero, expr 3 is evaluated and is the result – what is a= (2 > 3) ? 65 : 17; – only one of the second two expressions is ever evaluated he comma operator evaluates both of its operands, by 5 CMSC 212 The comma operator evaluates both of its operands, by definition first the left operand and then the right one, and the value of the right operand is the operator's result printf("useless but valid: %d\n", (1, 2, 3)); b= 1; c= 2; a= (b++, c += 2); b= 1; c= 2; a= b++, c += 2; b= 1; c= 2; if (c += 3, --b) printf("hmmm…"); Bit operations Numbers are represented in a computer using a fixed number of bits – commonly a
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2009 for the course CMSC 212 taught by Professor Staff during the Spring '08 term at Maryland.

Page1 / 4

Lecture07 - Last time Introduction to Low-Level Programming Concepts CMSC 212 Lecture 7 Chapter 10 Structures and unions pointers to structures

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