a fired missile couldnt get within 100 miles of a carrier without being destroyed by the strike force
But if it did the carrier has close in defense systems that project a wall of lead at a missle
https://nationalinterest.org/blog/the-buzz/five-reasons-us-aircraft-carriers-are-nearly-impossible-sink-17318