There is a difference between an ounce and a cup. An ounce is a measurement of weight and a cup represents volume. It’s often believed that 1 cup of any ingredient will always weigh 8 ounces, but this is not true for solids (flour, fruit, vegetables, etc.) and even some liquids.
An ounce can only be found using a scale. A cup is the amount of space required to hold a quantity of something.
When measuring a cup of fruits or vegetables, you would be measuring volume. For a great visual representation, see How Much is in a Cup of Fruits or Vegetables.