2019.10.08.pdf - Cartoon of the Day anonymous 1 Announcements ‣ Final Exam scheduled •December 19 •09:00 •PAC gym ‣ Midterm Exam •old exams

2019.10.08.pdf - Cartoon of the Day anonymous 1...

This preview shows page 1 - 14 out of 40 pages.

Cartoon of the Day 1 -- anonymous
Image of page 1
Announcements Final Exam scheduled •December 19 •09:00 •PAC gym Midterm Exam •old exams going on-line this week •no answer keys Assignment 2 2
Image of page 2
Announcements VOTE! in federal election •October 21 •advance poll here on campus: - Suite 110.3 Place Riel or Education Building Student Lounge - 10:00 – 20:30, October 5-9 3
Image of page 3
Announcements make-up lab •holiday October 14 •Wednesday, October 16 •S320 4
Image of page 4
Picking up from last day … 5
Image of page 5
Bitwise Operators highlights of example_11.c and example_11_log.txt •specifying octal or hexadecimal constants " %x " and " %o " format specification to printf() " %# " format modifier to printf() bitwise AND ( & ), inclusive OR ( | ), exclusive OR ( ^ ) left shift ( << ), right shift ( >> ), unary one's complement ( ~ ) pp. 277–288 of Kochan for more on bit operations pp. 1101–1102 of Sobell give decimal, octal, and hexadecimal equivalents 6
Image of page 6
Combining Operators and = highlights of example_12.c and example_12_log.txt " %% " format specification to printf() to get '%' for each of the binary operators ( + , - , * , / , % , << , >> , & , ^ , | ) there is an additional assignment operator of the form += , -= , *= , … expressions of the form expr1 op = expr2 , where op is one of the operators above expressions are equivalent to an expression of the form expr1 = expr1 op expr2 7
Image of page 7
Combining Operators and = e.g.: x *= y+z is equivalent to x = x*(y+z) , which algebraically is equivalent to x*y+x*z 8
Image of page 8
Input one method for obtaining input: scanf(3) parallels printf() •family of functions •input from std in •first argument is a format string •remaining arguments are addresses of the locations in which to store the values read pp 353–357 in Kochan text 9
Image of page 9
Recall the next two slides … 10
Image of page 10
Memory 11 each row is uniquely addressable via a numeric address width in bits
Image of page 11
Memory and Variables What happens when you create a variable in C or Java? •You reserve one (or more) memory location(s) for the use of that variable •You associate a logical name to the address of the (block of) memory location(s) - The association is in software only ; the hardware is unaware 12 int x; x
Image of page 12
Input operator to obtain the address of a variable: unary & •e.g.
Image of page 13
Image of page 14

You've reached the end of your free preview.

Want to read all 40 pages?

  • Spring '14

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors