InterviewSolution
Saved Bookmarks
| 1. |
Int x=y+z state the type of initialization statoc or dynamic |
|
Answer» Answer: Following are some interesting facts about static variables in C. 1) A static int variable remains in memory while the PROGRAM is running. A normal or auto variable is destroyed when a FUNCTION call where the variable was declared is over. For EXAMPLE, we can use static int to COUNT a NUMBER of times a function is called, but an auto variable can’t be used for this purpose. For example below program prints “1 2” |
|