is it illegal to drive with a headlight out?

I have no money for a new one but just got a warning from a cop for speeding (5mph over) and headlight out. I don't really have the money to replace it but can I get a ticket next time if I get pulled over for the headlight being out?

the smart thing to do is get two. if one's out, the other one should be going soon too (assuming you put them in around the same time)

it always seems to be the case. while youre out gettin headlamps, get your cars rear brake and or blinker lights too. theyre only 3 bucks and keep em in the glovebox. you dont want to be chiefin in the car and some hobag pulls you over because your cadles arent lit.