Cursing in front of children is not cool. I've been guilty of it from time to time if I'm frustrated with something. My daughter's heard me say "damn" or "shit" a few times, when it just slips out and she always calls me out on it.
Just like someone else said, they have to know that it's not always acceptable to speak that way, and as a parent, you have to set that example.
I have friends that drop f-bombs freely in front of their kids and it always makes me uncomfortable, because you can tell they hear it so often it doesn't even register. We're talking like 7 and 9 year olds. Only a matter of time before they drop one in front of a teacher.