Say I have a file, player.h
, and in player.h I have included the following:
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
Would I need to include these again in player.cpp
, where I flesh out the functions declared in the header file? If I don't, do I need to include them when I run main.cpp
, which calls the functions from my various .cpp's and .h's
School never really told me whether or not to do it, so I've always included everything across the board. If it's unnecessary is there any noticeable difference between including everything multiple times and not doing so?