why we import heade开发者_开发百科r file in the other file.
Its just another name, rather than #include
If you do not import the header file then the compiler doesn't know where some of the things you use in your code come from. Its like importing a dictionary when you are writing in a foreign language, without the dictionary you don't know what everything means or does.
In general "importing" (including) source files/header files is meant to let the current file "see" the objects defined in the imported one.
精彩评论