Lecture Summaries - Week 5
Jump To:
[Lecture Index |
Previous Week's Lectures |
Next Week's Lectures]
Topics covered:
- How functions allow us to more easily write complicated programs.
- Using functions to extend our interest rate program further
(intrate7.c)
- How the assignment operator really works.
- The general idea of separate compilation and linking.
- An example of our earlier interest rate program split into
two source files
(irmain.c,
page 37)
and
(irfuncs.c,
page 38).
- How to do
separate
compilation on Wiliki.
Reading: Chapter 2.6.
Topics covered:
- Bits, bytes, and words.
- How integers are represented in computers.
- How to convert a binary number to an integer.
- The different integer data types:
int, long, and short.
- Signed versus unsigned numbers.
- The smallest and largest values we can store in the different types.
- Reading and printing integers with scanf and printf
- How integer arithmetic works.
- How floating point numbers are represented in computers.
- The different floating point data types:
float and double.
- How floating point arithmetic works.
Reading: Chapter 3.1 - 3.4 (through page 53).
Topics covered:
- How we can implement "missing" math operators as functions.
- An example powerfunction to print x^y
for nonnegative, integer y's
(power1.c).
- An example main program to use power
(powmain.c).
- Extending our example to deal with negative exponents
(power2.c).
- Why C comes with a library of useful math functions.
- How we can use the C math library.
- Redoing our main program to use the standard library function
(usepow.c, page 55).
- How C automatically converts differing types.
- Conversions when we do arithmetic.
- Conversions when we do assignment.
- Conversions when we pass function parameters.
- How we can requesting conversions ourselves with casting.
Reading: Chapter 3.5 - 3.6 (through page 61).
[EE150 Home Page |
Top Of Page]