The code below is from the book Programming Interviews Exposed 4th, now, to fix this, there are two possible ways,
bool insertInFront( IntElement *head, int data