Question Details

No question body available.

Tags

c preprocessor-directive

Answers (2)

Accepted Answer Available
Accepted Answer
July 9, 2026 Score: 8 Rep: 38,034 Quality: Expert Completeness: 90%

There are 2 issues in your code:

  1. Missing trailing ; in return inttemplate and return footemplate.
  2. Invalid ; at the end of the Template macro definition.
    It should be without ;:
    #define Template(X) Template
    
    Note that macros perform textual substitution, and so the ; you put at the end of the macro definition is a part of the text that the preprocessor will replace.

Fixed version - live demo

Note: you should generally avoid giving the same name (e.g. Template) to separate entities (here e.g. the macro and the typedef struct). Even in cases where it is valid, it can confuse readers.

July 9, 2026 Score: 3 Rep: 85 Quality: Low Completeness: 30%

remove the semicolon(;) from macro:

#define Template(X) Template