Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd prefer to use C-style comments in C++ sources:

class Dog {
    string name;                /* The dog's name */
    ...
    void bark();                /* Print messages in Dog's
                                   language */
}

However, in cc-mode, when I enter ALT+;, I can only get C++-style comments:

class Dog {
    string name;                // The dog's name
    ...
    void bark();                // Print messages in Dog's
                                // language
}

Can I set the default comment style in cc-mode to C-style?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

One way is to set the comment-start and comment-end variables as follows:

(add-hook 'c++-mode-hook
          (lambda () (setq comment-start "/* " comment-end " */")))
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.