1.

Which of the sizes of data given below require us to shut off all interrupts while inputting them into a volatile variable?(a) 1 bit(b) 2 bit(c) 2 bytes(d) 0.5 bytesI got this question by my school teacher while I was bunking the class.The above asked question is from Variable Scope and Qualifiers topic in chapter Arduino Programming of Arduino

Answer»

Correct option is (C) 2 bytes

For explanation I would say: The volatile keyword has a LOT of uses and advantages in programming. However, when it COMES to inputting large quantities of data, ANYTHING more than a bit in size will definitely result in the formation of garbage values. So, in order to input that kind of data we need to shut off all interrupts before inputting the VALUE.



Discussion

No Comment Found

Related InterviewSolutions