Store values in library

By "library", do you mean "class", perhaps?

A class can have member variables, which can store values at runtime. All of the libraries classes that I've seen have member variables.

If you create a class and have a 'public' member variable, it's accessible in your code.

ie

myClass.value = 123;

if(myClass.value == 123)
   // Do something

Perhaps I'm misunderstanding you.