Can I fly through these military airfields' class C airspace?
When entering Class C Airspace:

Since all the airfields are Class C you would need to contact the approach control prior to entering.  Approach control should be able to direct you appropriately from there.  Approach control would handle traffic at all three airports. If the military airfield does not want civilian aircraft to cross the field for any reason approach control will direct you around it.  If there is nothing going on at the military field then approach control could let you cross over the field.  

When Departing Pensacola Field:

When departing Pensacola field you can request a Northeast departure through Clearance Delivery.  You could be granted the request to fly Northeast directly from the airport or they could make you fly East for a while then make a turn North to avoid the military airport.  Nevertheless you have to follow ATCs instructions whenever you are in Class C airspace.  

Side Note:

It is fairly common that when you have military airfield close to a Class C airport, the class C airspace will be extended over the military fields as well so that one approach control would handle all the traffic and deconflict traffic for all of the fields.  A similar situation exists for the Tucson area where the Class C includes Tucson International and Davis Monthan AFB.