Pregunta de entrevista de Genoptic

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

Respuesta de la entrevista

Anónimo

14 nov 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.