In pset3, I noticed that while cs50.h and stdio.h were included the usual way we encountered so far, bmp.h was included differently. I'm guessing bmp.h is not a part of the standard header files that come with C and hence the difference? Am I right or is there something else going on here?


You are correct. From this C Preprocessor doc:

2.1 Include Syntax

Both user and system header files are included using the preprocessing directive ‘#include’. It has two variants:

#include <file>

This variant is used for system header files. It searches for a file named file in a standard list of system directories. You can prepend directories to this list with the -I option (see Invocation).

#include "file"

This variant is used for header files of your own program. It searches for a file named file first in the directory containing the current file, then in the quote directories and then the same directories used for . You can prepend directories to the list of quote directories with the -iquote option.

  • Thanks @DinoCoderSaurus, though this brings up a few follow-up questions, if you could please help me understand those too... First, what's meant by prepending directories? Second, what are quote directories? Thanks in advance! Jul 20 '19 at 13:45
  • Oops, I missed a link in the doc snippet, answer corrected. Search iquote in the Invocation doc for those explanations. Jul 22 '19 at 11:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .