Most of us think that working out at the gym will help you shed inches off your waist. But many people actually gain weight despite going to the gym.

A recent survey by Forza Supplements polled 1,000 people on their diet and exercise habits and found that 26 percent of people surveyed actually put on weight after they started hitting the gym. Although, these people only went to the gym once a week, while others went daily.

Irregularity of exercise may be a factor in why many gym goers struggle to maintain their weight, or drop a few pounds. But Forza reps say there's likely another factor at play: People who work out tend to overindulge in food before and after their sweat sessions.

“People think working out harder can make up for eating unhealthy foods,” says J.J. Virgin, nutritionist and author of The Virgin Diet: Drop 7 Foods, Lose 7 Pounds, Just 7 Days. “But you can’t compensate for bad eating with exercise.”

Eating well (and enough) is key to burning fat and building muscle, says Virgin. So working out doesn’t grant you permission to gorge on whatever you’re craving.

If your intention is to maintain or shed weight, make sure to eat pre and post workout foods that will boost your overall performance and help your muscles recharge, says Virgin. You should, however, also be wary of how much you eat - even if it's a healthy snack - since eating too much of any food makes it harder for your body to burn it off later.