Where's 2?
It's in the middle of your linked list and in your print() function you only print the head and the tail. So there's no wonder it is not displayed in the standard output.
[1] → [2] → [3]
↑ ↑
[HEAD] [TAIL]
To print all the elements, iterate starting from the head and go until you reach nullptr and print elements one by one.
Further Notes
Use Standard Containers
In general, it is a good idea to use the standard containers offered by the language. They have been widely tested. Custom containers take time to implement and are prone to have bugs.
As mentioned earlier, you can just use the std::list if you need a doubly-linked list or std::forward_list if you need a singly-linked list.
Write Your Own Proper Generic Container
If you want to write your own container, you should do it properly. It is a good idea to write it in a way that it is widely usable and not just suitable for a very specific task (e.g. only supports ints).
So here are some tips:
- Implement the destructor to prevent memory leaking (release the resources!)
- Use generics (templates) to allow any kind of item to be stored in your linked list
- Instead of NULL, use the nullptr C++ keyword.
When Sharing Your Code
It is also a good idea to share your code in a state that it compiles. Have all the #include, #define, typedef, etc statements included with your code. This one someone could just simply take your code, run it and see what's going on, they won't need to spend time fixing it to be able to run it.