O'Reilly logo

Programming in C: A Practical Approach, First Edition by Ajay Mittal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7

Scope, Linkage, Lifetime and Storage Classes

Learning Objectives

In this chapter, you will learn about:

  • Scope and visibility of an identifier

  • Local variables and global variables

  • Linkage

  • Different types of linkages in C

  • The lifetime of an object

  • Different storage classes

  • How to allocate memory at the run time

7.1 Introduction

In the previous chapters, we have learnt about how to declare variables within a function and have seen that the amount of memory allocated to a variable depends upon its data type. We have restricted our discussion to the declaration of variables within a function (i.e. local variables) and have not discussed about the global variables (i.e. variables declared outside all the function definitions). The issues ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required