Embedded Software Engineer Question:

Download Job Interview Questions and Answers PDF

Tell me can static variables be declared in a header file?

Embedded Software Engineer Interview Question
Embedded Software Engineer Interview Question

Answer:

A static variable cannot be declared without defining it. A static variable can be defined in the header file. But doing so, the result will be having a private copy of that variable in each source file which includes the header file. So it will be wise not to declare a static variable in header file, unless you are dealing with a different scenario.

Download Embedded Software Engineer Interview Questions And Answers PDF

Previous QuestionNext Question
Please explain what is interrupt latency? How can you reduce it?Tell me what is NULL pointer and what is its use?