Access Violation

Question:

I get an “Access violation at address…” error, when I run my program. An error occurs on line “scanf(…)” but I can’t figure out what is wrong.

Answer:

In general, this runtime error occurs when you try to use a bad pointer (a pointer that is either null or dangling). You should check your scanf() function call again. Did you by a chance omit an ampersand before one of the arguments?

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: