melee attack with trace c++

Hi, I need an explain about melee attack…how can I develope it? how can it does to get hit?
I need to implement it for a school project…Can someone tell me something or post a link of a c++ tutorial?
thanks.