A cup of flour weighs a differing number of ounces based on the type of flour and method of scooping. One cup of regular all-purpose flour weighs approximately 4.5 ounces.
In the case of flour, measurement in cups refers to volume, while measurement in ounces refers to weight. This is why a cup of very fine cake flour weighs less than a cup of denser bread flour by almost three quarters of an ounce. Flour will also weigh a different amount depending on how it is scooped. One cup of packed flour weighs more than a cup of fluffed flour. Some recipes list dry ingredients by weight in ounces, which is more exact than volume measurements.
Ounces is also a volume measurement for fluids, which is why a cup of liquid is always exactly 8 fluid ounces.