Michael J. Pollard, who rose to fame in the 1967 hit film “Bonnie and Clyde” as C.W. Moss, the dimwitted gas station attendant who became a criminal accomplice, and went on to a long career as a Hollywood character actor, died on Wednesday at a hospital in Los Angeles. He was 80.

A friend, Dawn Walker, said in an interview that the cause was cardiac arrest.

Mr. Pollard had been a familiar face on television since the late 1950s. He most often played likable but socially inept characters, and usually ranked fairly far down on the cast list. In two separate shows, he played the cousin of a beloved supporting character — Jerome Krebs, cousin to Maynard G. Krebs (Bob Denver) on “The Many Loves of Dobie Gillis,” and Virgil, cousin to Deputy Barney Fife (Don Knotts), on “The Andy Griffith Show.”

He also had a memorable role in the first season of the television series “Star Trek,” in 1966, playing a creepy, mischievous teenage cult leader on a planet of children.