views:

80

answers:

2

Is #import or #include a job that is handled by the complier or by the linker?

+13  A: 

Anything that starts with # is a preprocessor directive and is expanded by the preprocessor, which is a step that happens before compilation.

sepp2k
+1: In short, "neither". Neither compiler nor linker.
S.Lott
Modern compilers usually integrate a preprocessor, but for the purpose of analysis and specification, you can still treat them separately.
Matthew Flaschen
+4  A: 

preprocessor -> compiler -> linker

# is handled by first - preprocessor

Andrey
You left out optimizer. ;-)
Brock Adams
and lexer, parser, and assembler :-)
Lie Ryan
i mentioned major and independent steps. optimizer, lexer, parser etc are parts of compiler
Andrey