9:45 PM
I don't know what do you mean. The field is produced by the whole (infinite) cylinder and it has radial symmetry. The gaussian is an imaginary surface which does not change the field in any way.
It is not the field of only the subsection you are calculating but the field of the whole infinite charged wire or cylinder. This so for any use of a gaussian surface. The fact that the flux through the gaussian is equal to the charge enclosed does not mean that the field is produced only by the charge enclosed.
You can see this ifyou take an arbitrary gaussian that does not include any charge. The flux through the surface will be zero but the field will not be so, if there are any charges outside the gaussian surfaces.