Static variables !

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Static variables and Random numbers

ivant
The previous message in this thread is from 3 years ago. It would be beneficial if you add some more context to your message, like what and how you're trying to achieve and what happens instead.
Reply | Threaded
Open this post in threaded view
|

Re: Static variables and Random numbers

Tames1
In reply to this post by RObinh1
Static variables are variables in computer programming that are allocated memory at compile-time and retain their values throughout the program's execution. They are commonly used for variables that need to be shared across multiple function calls, as their value persists between function calls. Static variables can also help improve program efficiency.



Reply | Threaded
Open this post in threaded view
|

Re: Static variables and Random numbers

WilliamEdward99
In reply to this post by RObinh1
I interpret your statement to mean that every time an object of MyClass uses SomeOtherMethod, MyStatic will increase by 1000. I do want it, yes. Although I managed to make something functional, it is quite ugly, and I don't believe what I created is the best solution.https://techemirate.com/how-to-airdrop-from-my-iphone-to-mac/ It makes use of a getter, the native code method Object(), which receives a variable, and three extra variables (ugg). I'll post the code if you like:
12