C static variable example

preview_player
Показать описание
This is a simple example of the static keyword with a variable.
Рекомендации по теме
Комментарии
Автор

thank you!! you literally made my day!!

preetamvarun
Автор

even if 'a' is static but it's local variable of Increment(), then it should die after every iteration of Increment(), isn't it????
Or, the concept of local variable doesn't fit in case of static variable.
Which one is correct, please clear my doubt??

mrinmoyhalder
Автор

Instead of using static with in a function, can't we use a global variable. Then there won't be any use of static there

sravankumar
Автор

Never ever ever use a goto statement in this form.
Avoid using them at all costs. Very disappointing to see a C tutorial with a goto statement in it.

XenoTravis