When you're visiting the Yellowstone park you can leave food inside your car but when you do leave food inside your car in Yellowstone Park you should make sure to keep the food completely out of sight.
And only leave food in your car during daylight hours but remove the food during the night and put it away from bears.
Also never put your food in a backpack or in your tent where the bears could smell the food and never leave the food in a pickup truck bed or strapped to a vehicle.
Try to put food high up away from bears and keep it out of sight.
If you have a car it's best to store the food inside the trunk where a bear cannot easily get too it.