Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

The GNU C Programming Tutorial - Questions for Chapter 6

Node:Questions for Chapter 6, Previous:Scope example, Up:Scope



Questions for Chapter 6

  1. What is a global variable?
  2. What is a local variable?
  3. Do parameters spoil functions by leaking the variables into other functions?
  4. Write a program gnoahs_park that declares 4 variables. Two global integer variables called num_gnus and num_gnats, and two local floating point variables within the function main, called avg_gnu_mass, and avg_gnat_mass. Then add another function called calculate_park_biomass, and pass avg_gnu_mass and avg_gnat_mass to it. How many different storage spaces are used when this program runs? (Hint: are avg_gnu_mass and avg_gnat_mass and their copies the same?)

 
 
  Published under free license. Design by Interspire