Glue secreted by seaweed or barnacles is an adaption to which of the following environments?

A shallow oceanic
B rocky intertidal
C deep ocean
D sublittoral