CSC180H1 Lecture Notes - Lecture 16: Fibonacci Number, Scanf Format String, Lanthanum Hexaboride

18 views2 pages
27 May 2019
School
Course

Document Summary

Answer to our last in-class exercise (fibonacci-iterative), at the bottom of this file, prior to the exercises: we know the output facility (with respect to the user) is "printf". > usage: int i; printf("enter a number: "); scanf("%d",&i); > what does &i mean: introducing pointers. Idea: when we tell c "int i;" that means we are asking c to reserve some space in memory, large enough to hold an integer type. When we use "i" in our code, that refers to the data stored at that place in memory. That is, what is the address of that data --- the address meaning, as it does linguistically, the location of the data. C gives you access to that location: &i. There is an inverse operator to "&", and that is "*". So if i do: printf("%d",i); that is the same as me doing: printf("%d",*(&i)); Specifically: *(&i) means: the data at the address of 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