توضیحات
ABSTRACT
You can only apply the auto storage class specifier to names of variables declared in a block or to names of function parameters. However, these names by default have automatic storage. Therefore the storage class specifier auto is usually redundant in a data declaration. You can initialize any auto variable except parameters. If you do not explicitly initialize an automatic object, its value is indeterminate. If you provide an initial value, the expression representing the initial value can be any valid C or C++ expression. The object is then set to that initial value each time the program block that contains the object’s definition is entered. Note that if you use the goto statement to jump into the middle of a block, automatic variables within that block are not initialized.
INTRODUCTION
The extern storage class specifier lets you declare objects and functions that several source files can use. An extern variable, function definition, or declaration makes the described variable or function usable by the succeeding part of the current source file. This declaration does not replace the definition. The declaration is used to describe the variable that is externally defined. An extern declaration can appear outside a function or at the beginning of a block. If the declaration describes a function or appears outside a function and describes an object with external linkage, the keyword extern is optional. If you do not specify a storage class specifier, the function is assumed to have external linkage. If a declaration for an identifier already exists at file scope, any extern declaration of the same identifier found within a block refers to that same object. If no other declaration for the identifier exists at file scope, the identifier has external linkage. It is an error to include a declaration for the same function with the storage class specifier static incompatible declarations. Including the extern storage class specifier on the original declaration is valid and the function has internal linkage.
چکیده
شما می توانید فقط مشخص کننده کلاس ذخیره سازی خودکار را به نام متغیرهای اعلام شده در یک بلوک یا به نام پارامترهای عملکرد اعمال کنید. با این حال، این اسامی به طور پیش فرض ذخیره سازی خودکار دارند. بنابراین ماشین مشخص کننده کلاس ذخیره سازی معمولا در یک اعلامیه داده باطل می شود. شما می توانید هر متغیر خودکار را به جز پارامترها راه اندازی کنید. اگر به طور صریح یک شیء خودکار را راه اندازی نکنید، مقدار آن نامعین است. اگر مقدار ابتدایی را ارائه می دهید، عبارت ای که نشان دهنده مقدار اولیه می شود، می تواند بیانگر C یا C ++ معتبر باشد. سپس هر بار که بلوک برنامه ای که شامل تعریف شی است وارد می شود، object به آن مقدار اولیه تعلق می گیرد. توجه داشته باشید که اگر از عبارت goto برای پرش به وسط یک بلوک استفاده کنید، متغیرهای خودکار در آن بلوک به صورت اولیه تنظیم نمی شوند.
مقدمه
مشخص کننده کلاس ذخیره سازی extern اجازه می دهد که اشیاء و توابع را که می توان از چندین فایل منبع استفاده کرد، اعلام کرد. یک متغیر extern، تعریف تابع یا اعلان باعث می شود که متغیر یا تابع توصیف شده توسط قسمت بعدی فایل منبع جاری قابل استفاده باشد. این اعلامیه تعریف را جایگزین نمی کند. این اعلامیه برای توصیف متغیری است که به صورت خارجی تعریف شده است. اعلام خارجی می تواند در خارج از یک تابع یا در ابتدای یک بلوک ظاهر شود. اگر اعلامیه یک تابع را توصیف می کند یا در خارج از یک تابع ظاهر می شود و یک شی را با لینک خارجی توصیف می کند، کلمه کلیدی extern اختیاری است. اگر یک مشخص کننده کلاس ذخیره سازی را مشخص نکنید، تابع فرض می شود که پیوند خارجی داشته باشد. اگر یک اعلامیه برای یک شناسه در محدوده فایل در حال حاضر وجود داشته باشد، هر اعلامیه خارجی یک شناسه مشابه در داخل یک بلوک به همان شیء اشاره دارد. اگر هیچ اعلام دیگری برای شناسه در محدوده فایل وجود ندارد، شناسه دارای پیوند خارجی است. این خطا شامل یک اعلامیه برای عملکرد مشابه با اعلامیه های ناسازگار استاتیک مشخص کننده کلاس ذخیره سازی است. شامل مشخص کننده کلاس ذخیره سازی extern در اعلام اصلی معتبر است و تابع دارای پیوند داخلی است.
Year: 2016
Publisher: 0
By : 0
File Information: English Language/ 3 Page / size: 200 KB
Only site members can download free of charge after registering and adding to the cart
سال : 1395
ناشر : 0
کاری از : 0
اطلاعات فایل : زبان انگلیسی / 3 صفحه / حجم : KB 200
نقد و بررسیها
هنوز بررسیای ثبت نشده است.