A must see at least one black hat, or she would know that her hat is black since they are not all white. B also must see at least one black hat, and further, that hat had to be on C, otherwise she would know that her hat was black (since she knows A saw at least one black hat). So C knows that her hat is black, without even seeing the others' hats.

lib/DbaDatabase.php:134: Warning: dba_replace() [<a href='function.dba-replace'>function.dba-replace</a>]: You cannot perform a modification to a database without proper access