Add the following line in the .h file as well

#include <iostream>
using namespace std;