Its for an assignment for one of my classes. We are supposed to have a code where you enter the patron's age and are told a ticket price. We are to use a void function (boxOffice) with one parameter, age. IF you are under 12, ticket price is $5.00, over 62 is $5.00 and anyone else is $8.00. The code I attached is a pass by value and I am wondering how would I alter the code to make it pass by reference?
Your code works either way, passing by value or by reference. You are not making a change to the variable a you create in main() when you pass it to your function. You don't need to pass it by a reference, copying a single POD is a very trivial copy operation.
In the future, PLEASE use code tags for your source code, as I did. It makes it MUCH easier to read. You could edit your post and add code tags.
http://www.cplusplus.com/articles/jEywvCM9/