OK.
Right now, each ship has a single property, max caliber, and that determines what cannon the ship can mount in a very simple way.
I.e.
If cannon.caliber <= ship.maxcaliber, can mount cannon.
What you and Kieron are talking about is more complex, i.e. a Spanish ship might mount only Spanish guns, and some ships could mount heavy carronades than long guns, etc, so you would need a better way to see if a certain cannon can be loaded on a ship.
A bitmask is a compressed way of expressing true/false for a number of entries (since true/false can be represented as 1/0).
i.e. let's say you have eight cannon types (hah, a byte!).
A, B, C, D, E, F, G, H.
If the ship can mount none of them, we express it as
00000000
If the ship can mount C, F, and H, but no others, that's
00100101
and so forth.
So there is a 1:1 correspondence between the mask and an integer `1-255`.
The advantage to this is that it can be stored as an int, simply by converting the number from binary to decimal (though if we were _really_ programming, there'd be no need to convert).
You can use windows calc in scientific mode to convert between binary and decimal bases; so 00000000 is of course 0; and 00100101 is 37.