This is a simple C*+ question and I’d suggest doing a little bit of research into the C*+ language. Here is an article on void pointers:
Here is a (non-portable) fix to your question above code:
_body->SetUserData( (void*) 2);
Another way would be to do something like this.
int* number = new int(2);
A more correct and portable way to set user data is to pack any data into a struct and pass a pointer from that struct.