How to return a value from a void function and use it inside the void loop?

You already have a global variable named intPressure. I'm not sure I understand what you are getting at.

Perhaps you should go to google and search for "C++ variable scope" and read some of the articles it finds. I think that may help to clear up some of your confusion.