Pergunta de entrevista da empresa Genoptic

What is the difference volatile, const ,and static in C.

Resposta da entrevista

Sigiloso

14 de nov. de 2025

Volatile qualifier means that the compiler cannot apply optimizations or reorder access to the variable. Const qualifier means that the variable cannot be modified through code. If you do attempt to do so, the compiler will provide a diagnostic. Static is a storage qualifier that gives the variable static storage duration.