Practice mode C Language

What does the ## operator do inside a C macro definition?

Correct answer D. It joins two tokens into a single token

Explanation

## is the token-pasting operator: in #define CAT(a, b) a##b, CAT(x, y) produces the single identifier xy. The single # operator is the different one that makes a string literal. Token pasting is used to generate related names, such as functions or variables with a common prefix, from one macro. The pasted result must form a valid token.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.