However, I do not think you meant that. You meant something like this:

int* ptr = new int(5);
std::cout << *ptr;

When you assign 5 to ptr directly without new, you are trying to give it an address rather than a value. Pointers holds an address to some place where the value exist rather than holding a a direct value.