More sophisticated alternatives include yasnippet or skeleton mode. They are probably overkill for something this simple, but are useful tools if you want more sophisticated templating.
EDIT: I'm not aware of any cc-mode magic that allows for different behaviour inside comments. I don't use cc-mode much, but I don't see anything obvious in the manual. Here's a bit of code that may do what you want though:
The simplest way to do this would be something like this (in your .emacs):
More sophisticated alternatives include yasnippet or skeleton mode. They are probably overkill for something this simple, but are useful tools if you want more sophisticated templating.
EDIT: I'm not aware of any cc-mode magic that allows for different behaviour inside comments. I don't use cc-mode much, but I don't see anything obvious in the manual. Here's a bit of code that may do what you want though: