Put the "variable" on the command line as an argument. See the usage for main's arguments, argc and argv []. Give it a shot and if you have troubles, post back with your attempted code.

Be sure and learn about code tags before you post code (see the "Before you make a query" thread).