i debugged my code and it gives the following error just as it calls my function

"Unhandled exception at 0x1026f8e0 in Assignment 3_Question 2.exe: 0xC0000005: Access violation reading location 0x00000000."