Skip to main content
light copyedit with a bit of clarification
Source Link
tchrist
  • 137.3k
  • 49
  • 376
  • 609

The second option is correctcorrect; that is, i.e. the line is not required to contain any other informationnot required to contain any further information.

Programming Explanation

The C/C++ preprocessor is invoked by the presence of a preprocessor directive at the beginning of a line in the source code, e.g. "#include foo.h" to include For example, a line stating #include foo.h is a directive to the preprocessor pull in the literal source code contained in the external file foo“foo.hh” right then and there during the compilation of the file using that directive. It’s a way to merge source code from several different files into one logical compilation.

The preprocessor ignores nullempty lines, so it can be invoked by a single "#"# character in the first position of the line, after which it determines that no directive is present and so returns control to the compiler without doing anything at all.

There is presumably some reason for invoking the preprocessor without giving it any immediate function to perform.

That said, you would not want to have characters after the "#"# that could be interpreted by the preprocessor as something it was programmed to act on, such as writing an error message for an unrecognized directive, so your first option is not entirely wrong. The nullempty line is a directive in its own right.

However, your question was about invoking the preprocessor, not what it did after it had been invoked :)

Edited by popular demand (!) to add:

Military Explanation

A similar situation arises in military drill. The drill commander issues commands in two (possibly three) parts. For example: to command troop number two in a squadron to stand at ease, the commander might call:

  • Introductory, identifies the recipients: "Two troop.",
  • Preparatory, identifies the command about to come: "Stand at....."
  • Execution, a single word identifying the moment to act: "EASE!"

Sometimes a commander will need to change a command before it can be executed. The expression "As you were" that can be used to interrupt the preparatory statement before the execution.

It's also not unknown for a commander to call out the introductory part, alerting the soldiers that something is about to happen, e.g. coming to attention after standing easy to watch a presentation.

If you were writing a realistic manual for drill commanders, you would want to include these cases. You would probably have words to the effect that:

  • You can use the introductory part of the command to alert your soldiers that a command will be coming shortly, and

  • The introductory part need not be followed immediately by a preparatory command,

  • You are strongly advised to notnot to follow the introductory command with garbled and confusing expressions. It gets people really annoyed.

These will not sound exactly right to people who have done military drill (and I'm not talking about drill team choreography here), but that's because people in real life are somewhat more complex than compilers and preprocessors, and their actual use of language is harder to describe.

However, the basic idea is that an expression to get attention (or invoke the preprocessor) does not need to be followed by an expression requiring an action, but that anything that does follow should not be subject to misinterpretation. Silence (a nullan empty line) is sometimes the best bet.

The second option is correct, i.e. the line is not required to contain any other information.

The C/C++ preprocessor is invoked by the presence of a preprocessor directive at the beginning of a line in the source code, e.g. "#include foo.h" to include the source code in the file foo.h.

The preprocessor ignores null lines, so it can be invoked by a single "#" character in the first position of the line, after which it determines that no directive is present and returns control to the compiler.

There is presumably some reason for invoking the preprocessor without giving it any immediate function to perform.

That said, you would not want to have characters after the "#" that could be interpreted by the preprocessor as something it was programmed to act on, such as writing an error message for an unrecognized directive, so your first option is not entirely wrong. The null line is a directive in its own right.

However, your question was about invoking the preprocessor, not what it did after it had been invoked :)

Edited by popular demand (!) to add:

A similar situation arises in military drill. The drill commander issues commands in two (possibly three) parts. For example: to command troop number two in a squadron to stand at ease, the commander might call:

  • Introductory, identifies the recipients: "Two troop.",
  • Preparatory, identifies the command about to come: "Stand at....."
  • Execution, a single word identifying the moment to act: "EASE!"

Sometimes a commander will need to change a command before it can be executed. The expression "As you were" that can be used to interrupt the preparatory statement before the execution.

It's also not unknown for a commander to call out the introductory part, alerting the soldiers that something is about to happen, e.g. coming to attention after standing easy to watch a presentation.

If you were writing a realistic manual for drill commanders, you would want to include these cases. You would probably have words to the effect that:

  • You can use the introductory part of the command to alert your soldiers that a command will be coming shortly, and

  • The introductory need not be followed immediately by a preparatory command,

  • You are strongly advised to not follow the introductory command with garbled and confusing expressions. It gets people really annoyed.

These will not sound exactly right to people who have done military drill (and I'm not talking about drill team choreography here), but that's because people in real life are somewhat more complex than compilers and preprocessors, and their actual use of language is harder to describe.

However, the basic idea is that an expression to get attention (or invoke the preprocessor) does not need to be followed by an expression requiring an action, but that anything that does follow should not be subject to misinterpretation. Silence (a null line) is sometimes the best bet.

The second option is correct; that is, the line is not required to contain any further information.

Programming Explanation

The C/C++ preprocessor is invoked by the presence of a preprocessor directive at the beginning of a line in the source code. For example, a line stating #include foo.h is a directive to the preprocessor pull in the literal source code contained in the external file “foo.h” right then and there during the compilation of the file using that directive. It’s a way to merge source code from several different files into one logical compilation.

The preprocessor ignores empty lines, so it can be invoked by a single # character in the first position of the line, after which it determines that no directive is present and so returns control to the compiler without doing anything at all.

There is presumably some reason for invoking the preprocessor without giving it any immediate function to perform.

That said, you would not want to have characters after the # that could be interpreted by the preprocessor as something it was programmed to act on, such as writing an error message for an unrecognized directive, so your first option is not entirely wrong. The empty line is a directive in its own right.

However, your question was about invoking the preprocessor, not what it did after it had been invoked :)

Military Explanation

A similar situation arises in military drill. The drill commander issues commands in two (possibly three) parts. For example: to command troop number two in a squadron to stand at ease, the commander might call:

  • Introductory, identifies the recipients: "Two troop.",
  • Preparatory, identifies the command about to come: "Stand at....."
  • Execution, a single word identifying the moment to act: "EASE!"

Sometimes a commander will need to change a command before it can be executed. The expression "As you were" that can be used to interrupt the preparatory statement before the execution.

It's also not unknown for a commander to call out the introductory part, alerting the soldiers that something is about to happen, e.g. coming to attention after standing easy to watch a presentation.

If you were writing a realistic manual for drill commanders, you would want to include these cases. You would probably have words to the effect that:

  • You can use the introductory part of the command to alert your soldiers that a command will be coming shortly, and

  • The introductory part need not be followed immediately by a preparatory command,

  • You are strongly advised not to follow the introductory command with garbled and confusing expressions. It gets people really annoyed.

These will not sound exactly right to people who have done military drill (and I'm not talking about drill team choreography here), but that's because people in real life are somewhat more complex than compilers and preprocessors, and their actual use of language is harder to describe.

However, the basic idea is that an expression to get attention (or invoke the preprocessor) does not need to be followed by an expression requiring an action, but that anything that does follow should not be subject to misinterpretation. Silence (an empty line) is sometimes the best bet.

added 1718 characters in body
Source Link
user205876
user205876

The second option is correct, i.e. the line is not required to contain any other information.

The C/C++ preprocessor is invoked by the presence of a preprocessor directive at the beginning of a line in the source code, e.g. "#include foo.h" to include the source code in the file foo.h.

The preprocessor ignores null lines, so it can be invoked by a single "#" character in the first position of the line, after which it determines that no directive is present and returns control to the compiler.

There is presumably some reason for invoking the preprocessor without giving it any immediate function to perform.

That said, you would not want to have characters after the "#" that could be interpreted by the preprocessor as something it was programmed to act on, such as writing an error message for an unrecognized directive, so your first option is not entirely wrong. The null line is a directive in its own right.

However, your question was about invoking the preprocessor, not what it did after it had been invoked :)

Edited by popular demand (!) to add:

A similar situation arises in military drill. The drill commander issues commands in two (possibly three) parts. For example: to command troop number two in a squadron to stand at ease, the commander might call:

  • Introductory, identifies the recipients: "Two troop.",
  • Preparatory, identifies the command about to come: "Stand at....."
  • Execution, a single word identifying the moment to act: "EASE!"

Sometimes a commander will need to change a command before it can be executed. The expression "As you were" that can be used to interrupt the preparatory statement before the execution.

It's also not unknown for a commander to call out the introductory part, alerting the soldiers that something is about to happen, e.g. coming to attention after standing easy to watch a presentation.

If you were writing a realistic manual for drill commanders, you would want to include these cases. You would probably have words to the effect that:

  • You can use the introductory part of the command to alert your soldiers that a command will be coming shortly, and

  • The introductory need not be followed immediately by a preparatory command,

  • You are strongly advised to not follow the introductory command with garbled and confusing expressions. It gets people really annoyed.

These will not sound exactly right to people who have done military drill (and I'm not talking about drill team choreography here), but that's because people in real life are somewhat more complex than compilers and preprocessors, and their actual use of language is harder to describe.

However, the basic idea is that an expression to get attention (or invoke the preprocessor) does not need to be followed by an expression requiring an action, but that anything that does follow should not be subject to misinterpretation. Silence (a null line) is sometimes the best bet.

The second option is correct, i.e. the line is not required to contain any other information.

The C/C++ preprocessor is invoked by the presence of a preprocessor directive at the beginning of a line in the source code, e.g. "#include foo.h" to include the source code in the file foo.h.

The preprocessor ignores null lines, so it can be invoked by a single "#" character in the first position of the line, after which it determines that no directive is present and returns control to the compiler.

There is presumably some reason for invoking the preprocessor without giving it any immediate function to perform.

That said, you would not want to have characters after the "#" that could be interpreted by the preprocessor as something it was programmed to act on, such as writing an error message for an unrecognized directive, so your first option is not entirely wrong. The null line is a directive in its own right.

However, your question was about invoking the preprocessor, not what it did after it had been invoked :)

The second option is correct, i.e. the line is not required to contain any other information.

The C/C++ preprocessor is invoked by the presence of a preprocessor directive at the beginning of a line in the source code, e.g. "#include foo.h" to include the source code in the file foo.h.

The preprocessor ignores null lines, so it can be invoked by a single "#" character in the first position of the line, after which it determines that no directive is present and returns control to the compiler.

There is presumably some reason for invoking the preprocessor without giving it any immediate function to perform.

That said, you would not want to have characters after the "#" that could be interpreted by the preprocessor as something it was programmed to act on, such as writing an error message for an unrecognized directive, so your first option is not entirely wrong. The null line is a directive in its own right.

However, your question was about invoking the preprocessor, not what it did after it had been invoked :)

Edited by popular demand (!) to add:

A similar situation arises in military drill. The drill commander issues commands in two (possibly three) parts. For example: to command troop number two in a squadron to stand at ease, the commander might call:

  • Introductory, identifies the recipients: "Two troop.",
  • Preparatory, identifies the command about to come: "Stand at....."
  • Execution, a single word identifying the moment to act: "EASE!"

Sometimes a commander will need to change a command before it can be executed. The expression "As you were" that can be used to interrupt the preparatory statement before the execution.

It's also not unknown for a commander to call out the introductory part, alerting the soldiers that something is about to happen, e.g. coming to attention after standing easy to watch a presentation.

If you were writing a realistic manual for drill commanders, you would want to include these cases. You would probably have words to the effect that:

  • You can use the introductory part of the command to alert your soldiers that a command will be coming shortly, and

  • The introductory need not be followed immediately by a preparatory command,

  • You are strongly advised to not follow the introductory command with garbled and confusing expressions. It gets people really annoyed.

These will not sound exactly right to people who have done military drill (and I'm not talking about drill team choreography here), but that's because people in real life are somewhat more complex than compilers and preprocessors, and their actual use of language is harder to describe.

However, the basic idea is that an expression to get attention (or invoke the preprocessor) does not need to be followed by an expression requiring an action, but that anything that does follow should not be subject to misinterpretation. Silence (a null line) is sometimes the best bet.

Source Link
user205876
user205876

The second option is correct, i.e. the line is not required to contain any other information.

The C/C++ preprocessor is invoked by the presence of a preprocessor directive at the beginning of a line in the source code, e.g. "#include foo.h" to include the source code in the file foo.h.

The preprocessor ignores null lines, so it can be invoked by a single "#" character in the first position of the line, after which it determines that no directive is present and returns control to the compiler.

There is presumably some reason for invoking the preprocessor without giving it any immediate function to perform.

That said, you would not want to have characters after the "#" that could be interpreted by the preprocessor as something it was programmed to act on, such as writing an error message for an unrecognized directive, so your first option is not entirely wrong. The null line is a directive in its own right.

However, your question was about invoking the preprocessor, not what it did after it had been invoked :)