Bernard Fox, a Welsh-born actor who spotted the iceberg that sank the Titanic in “A Night To Remember” and went on to play memorably daffy characters on the sitcoms “Bewitched” and “Hogan’s Heroes,” died on Wednesday in Van Nuys, Calif. He was 89.

A spokesman, Harlan Boll, said the cause was heart failure.

Mr. Fox was probably best known for his role on “Bewitched”: Dr. Bombay, the flamboyant family doctor regularly summoned to reverse spells and devise potions for Samantha Stephens, the witch played by Elizabeth Montgomery, and her family.

Mr. Fox endowed Dr. Bombay, a warlock, with a dotty rectitude and utter confidence, reinforced by his crisp and friendly British accent.

In an interview with the fan site bewitched.net, Mr. Fox said: “If I’d just gone for an ordinary doctor, you wouldn’t have heard any more about it. But because I made him such a colorful character, that’s why they wanted him back.