Assignment #1

203 views
Skip to first unread message

Yogesh Sonik

unread,
Sep 14, 2020, 2:40:24 PM9/14/20
to cmpt-295-sfu

SFU ID:301363019 
Github username:YSonik
Line and file: tree.c: line 1
Question: From my understanding, a user made header file should be included like so #include "tree.h" but the tree.c file uses #include <tree.h> so I'm a little confused as to why it is done this way.

Arrvindh Shriraman

unread,
Sep 14, 2020, 4:00:36 PM9/14/20
to cmpt-295-sfu
#include "tree.h" is a path-based inclusion i.e., it is trying to look for tree.h in ./

#include <tree.h> searches in all the standard paths (e.g., /usr/include).  We can add to the list of standard paths  by including -I  flag to gcc.

Type make -n in tree/ and you can see the list of commands we use. 
One of the flags will be -I which specifies the path to tree.h. 
Reply all
Reply to author
Forward
0 new messages