1 / 11

CSC 253

Learn about the differences between Java and C, explore why operating systems are written in C, and understand the advantages and disadvantages of pointers in programming. Discover the benefits of C and Java, examine variables used by functions, and delve into how values are passed and returned in functions. Dive into the consequences of using global variables, avoiding arithmetic on characters, and explore practical programming examples.

joehanson
Download Presentation

CSC 253

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 253 Lecture 2

  2. Some differences between Java and C

  3. C vs. Java • Why are OSs written in C? • Two steps in the Java compile-run sequence are “skipped” with C. • What two steps? • What’s the advantage of skipping them? • What’s “bad” about skipping them?

  4. Pointers • Advantages? • Disadvantages?

  5. Summary: Advantages of C

  6. Summary: Advantages of Java

  7. Variables used by > 1 function • Should they be … • Global? • … • How can such a value be passed into a function? • How can such a value be returned from the function?

  8. Why not use lots of globals?

  9. Why should you not do arithmetic on characters?

  10. Let’s write a program to … • determine the value of INT_MAX; • that is, show an integer i that prints as positive, whereas i+1 prints as negative.

  11. Let’s write a program to • look at the bits in INT_MAX and see how it’s represented in our computer.

More Related