devxlogo

Access Violation

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?

devx-admin

Share the Post: