This appears to be C+ homework. We want to help you get the information you need, but we also are concerned that just giving you the answer will rob you of the necessary skills you’ll need to develop. If you can describe the things you’ve tried and how they haven’t worked for you, perhaps someone can give you a nudge in the right direction.
what tools do i use to achieve this ?
Suggest you investigate “Handwriting Recognition”. You don’t indicate your target platform; open-source or commercial software, so it is difficult to suggest libraries. For example, Microsoft has Microsoft.Ink and some sort of Azure service.