Locations & access / Linkage & Storage Duration
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
This lesson contains some formal descriptions and it can be a little confusing. An identifier declared in different scopes or more than once in the same scope by the same name can be made to refer to the same object through the process known as linkage. Identifiers that have different names have no linkage. There are three kinds of linkage; external, internal and none. For assemble to have no linkage, it must be a declaration of a unique entity. A function parameter, for example, has no linkage. The declaration of a variable with file scope and the storage class specifier static has internal linkage. A function definition declared with a static storage class has file scope and internal linkage. If a declaration of an identifier has file scope and it does not have the class specifier static, then it has external linkage. If a declaration of an identifier for a function has no storage class specifier, its linkage is determined as if it were defined by the storage class specifier extern. If no prior definition of an identifier is visible or if the prior definition specifies no linkage, the linkage is external. If within the same scope an identifier appears to have both internal and external linkage, the linkage is undefined by the specification. Storage duration has to do with the lifetime of an object; how long it does actually exist. There are three kinds of duration. As long as the object exists, it has a constant address and retains the values that are assigned to it, the result of referring to an object outside of its lifetime is undefined. An object that exists for the entire life of the program, it gains its address when the program starts running and keeps it until the program is finished, has static duration. These are the variables that you define outside of functions or with the keyword static. They are given a place by the compiler. An object that is declared with no linkage and without the static class specifier has automatic duration. These are variables defined within a scope. The executable code assigns them a location when the scope is entered and removes the memory when the scope is exited. If the scope is entered recursively, new instances of the object appear each time. The address of such an item could be different with each execution of the program. Allocated duration memory is allocated by a specific function call. The address of such storage is valid for the entire program and only exists while the program is running. It can, of course, be de-allocated during the running of a program with another specific system call.
Tutorial Information
| Course: | Advanced C Programming |
| Author: | Arthur Griffith |
| SKU: | 33965 |
| ISBN: | 1-935320-24-6 |
| Release Date: | 2009-01-30 |
| Duration: | 5.5 hrs / 82 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 