471,873 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

Access violation in C++ Borland Builder

I am working with Borland C++ builder and got this error message:

Debugger Exception Notification

Project Project1.exe raised exception class EAccessViolation with message 'access violation at address 00404F6A in module 'Project.exe'. Read of address 00000022'. Process stopped. Use Step or Run to continue.

What does it mean and how can I get rid of it?
Sep 4 '06 #1
2 11830
9,065 Expert Mod 8TB
I don't know, but most of this type of problem are cause by either trying to dereference a pointer that does not have a good value or by accessing an array index in an array that is larger than the array was defined with.



int array[5];
char *p = (char *)2; // Assuming 2 is an invalid pointer value

*p = 7; // Possible exception invalid deference of a pointer

array[5] = 6; // Out of bounds array access, possible exception
Sep 4 '06 #2
I believe it`s not that. To give you a better view what`s going on I`ll explain when it occurs:
My program uses shortest path algorithm, for example it seeks for a shortest way between 2 cities. When cities are close to each other, it works fine. But when I enter cities with a bigger distance between them, this error occurs. In my opinion program cannot allocate enough memory for more complicated operation. I`m a very beginner of C++, that`s why I`m not sure if I am right. Is there any way I could fix it?
Sep 5 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by TGF | last post: by
49 posts views Thread by Relaxin | last post: by
15 posts views Thread by Chris | last post: by
24 posts views Thread by serdar | last post: by
reply views Thread by Xproblem | last post: by
22 posts views Thread by smartwolf agassi via DotNetMonster.com | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.