I am trying to build a struct array and input the different attributes to that struct array with a loop but I am being prompted with an error message saying "request for member ‘volume’ in ‘s’, which is of non-class type ‘water_bottle [3]’"
s is an array of water_bottle objects, not an individual water_bottle.
Also, cin and cout are two different streams; you can't feed an endl into cin using <<.
1 2 3 4
for(int i = 0; i < 3; i++){
cin >> s[i].color;
cin >> s[i].volume;
}