How do i know the bones name?

I have also now viewed this article: How to attach a weapon(Gun) to a character bone?, and put in the code there, but it appears that the gun now is not connected to the character at all! Should the entity be in the scene when we add it?