C Tutorial/Data Type/Register variable


Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Перейти к: навигация, поиск

Register variable

Register variable is for faster access.

Register variable cannot be global variables.


#include <stdio.h>
main()
{
    register int i = 0;   
    for( i=0;i<2;i++)
    {
        printf("value of i is %d\n",i);
    }
}
value of i is 0
      value of i is 1