My istream and ostream is not running

as head is a pointer of class node, you cannot take it as input.