Practice mode C Language

Which predefined macro expands to the current line number in the source file?

Correct answer A. __LINE__

Explanation

__LINE__ expands to an integer constant giving the current source line, and __FILE__ gives the file name as a string literal. Together they are used in logging and assert messages. __DATE__ is the compilation date, and __func__ is not a macro but a predefined identifier holding the current function's name, added in C99.

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.