csc 253 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
CSC 253 PowerPoint Presentation
Download Presentation
CSC 253

Loading in 2 Seconds...

play fullscreen
1 / 6

CSC 253 - PowerPoint PPT Presentation


  • 79 Views
  • Uploaded on

CSC 253. Lecture 7. Storage Classes. Of the following storage class modifiers, extern auto register const volatile static which are in some sense “opposites”? which of them are mutually exclusive?. static variables. Let’s write a program that demonstrates what a static variable does.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CSC 253' - terentia-avis


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
csc 253

CSC 253

Lecture 7

storage classes
Storage Classes
  • Of the following storage class modifiers,
    • extern auto
    • register const
    • volatile static
  • which are in some sense “opposites”?
  • which of them are mutually exclusive?
static variables
static variables
  • Let’s write a program that demonstrates what a static variable does.
  • What are some uses of static variables?
let s try a program with extern s
Let’s try a program with externs
  • Declare int i in one file.
  • Declare int j in another file.
  • Declare one function in each of the two files.
  • What do we need to do to use all the variables and functions from a single main()?
  • What happens if we make them static?
    • Why?
common errors
Common errors
  • Let’s write programs demonstrating these …
    • Same name, different type
      • this would occur if you used extern to declare a variable, but
      • then gave it a different type than its original declaration.
    • Multiple different definitions of the same function with external scope.
variable of arguments
Variable # of arguments

Let’s write a sum function that takes a variable number of arguments.