c++ - Avoid global variables in my program -


i have global variables in program , tried avoid them don't know how..

here program: here

is there alternative avoid variables?

and other remark appriciated too

i think have multiple possibilities.

  1. create class , put functions , global variables inside (preferred way)
  2. if care name conflicts can use unnamed namespaces
  3. it global variable used in 1 function, declare static variable inside function (its value kept between calls)

Comments

Popular posts from this blog

javascript - Why Selenium can't find an element that is graphically visible -

android - Basic camera in app -

javascript - Can I make channel list with youtube API if I do not own the channel? I don't receive error but nothing display? -