+ 1

How to avoid global variables

Refer code below: How to complete this code without changing function signature and not using global variables? https://sololearn.com/compiler-playground/cMmIifMYJoFg/?ref=app P.s. I can use static in function and complete the code. Just checking for other alternative as static solution was ok but more option was asked

13th Feb 2025, 5:43 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
2 Réponses
+ 1
Besides global or static you could write it to some permanent storage such as a disk file or Windows registry. And then there is my other trick of writing to other stack frames 😋
13th Feb 2025, 8:59 AM
Brian
Brian - avatar
0
Thanks Brian
13th Feb 2025, 11:08 AM
Ketan Lalcheta
Ketan Lalcheta - avatar