We have a function that is called via SetTimer with a period of time T.
We have a constant that is used only in that function. Its size is S bytes.
Should we make it local or static?
Static vs local constant.
Static vs local constant.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Re: Static vs local constant.
If it is truly a constant and the value will never change, it can be local as long as it is initialized within the function each time the function is called. If the function will change that value AND you wish to retain that value between function calls, make it static.
Russ
Russ
Who is online
Users browsing this forum: No registered users and 297 guests