Question about different ways to declare objects and their effects on RAM usuage

Is dynamically creating instances of objects similar to using local variables in functions?

Yes. The dynamically created objects go out of scope at the end of the block they are defined in, just like local variables. When they go out of scope, the desctructor is called, freeing the memory for other uses.

Are there any pro's or con's (related to RAM usage) with the three examples above?

Well, obviously the second example won't work, so you really only have two working examples. One uses global variables. The other uses local variables. If the objects don't need to persist information in the instance, then local variables will use less memory all the time. That's OK for some things, but not for others.

For the time the object exists, it uses the same amount of memory whether it is a local object, a static object, or a global object. Only its lifetime changes.