Initialization - Programming Tutorials

Programming Tutorials

Programming Tutorials

Ads Here

Initialization

Initialization means assigning a value to the variable. If variables are not explicitly initialised, then external and static variables are initialised to zero; pointers (see ch 8) are initialised to NULL ; auto and register variables have undefined values. int x = 1; char quote = '\''; long day = 60 * 24; int len = strlen(s); external and static initialisation done once only. auto and register initialisation done each time block is entered. external and static variables cannot be initialised with a value that is not known until run-time; the initialiser must be a constant expression.

No comments:

Post a Comment