Computer Science 2211A/B Lecture Notes - Lecture 11: Scanf Format String, Undefined Behavior, Local Variable

83 views2 pages

Document Summary

Scope rules allow us to determine which meaning is relevant. Most important scope rule: when a declaration inside a block names an identifier that is already visible, the new declaration temporarily hides the old one and the identifier is the new one. At the end of the block, the identifier regains its old meaning. Declaration 1: i is a variable (file scope) Declaration 2: i is parameter with block scope. Declaration 3: i is an automatic variable (block scope) Declaration 4: i is automatic variable (block scope) Most computers, main memory is divided into bytes and each byte is capable of storing. Each variable in a program occupies one or more bytes of memory. If there are n bytes of memory, addresses as numbers range from 0 to n-1. Address of the first byte is address of variable. Addresses can be stored in special pointer variables. Storing address of variable i in p is saying p points to i .

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents