Use a static variable

http://ideone.com/Sg3yDi