ARM Holdings Interview Question
27 Interview Reviews |
Back to all ARM Holdings Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Engineering Graduate at ARM Holdings:
volatile and static C keywords
See more for this ARM Holdings Engineering Graduate Interview
Helpful Question?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
by Josef Ahmad:
The volatile keyword can be used in other contexts too, e.g. immediately after the "asm" keyword, symbolizing that the inline assembly statement must be kept in the given order of the instruction flow (thus avoiding some "inter-instruction" optimization, like moving a statement out of a loop, or filling a branch delay slot).
Regarding the static variable: if applied to a function, it specifies the function is visible only inside the source file it is declared. If applied to a variable, it makes a global variable invisible outside the source file (as a static function), while, for a local variable, it specifies the variable is not automatic, but it is allocated statically, hence the value of the variable will be the same when the function is called again.