Question:
how can i remove the penalty of access violation in c programming?
mmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2007-04-11 04:38:12 UTC
I use microsoft visual studio 6.0 in writing my code in c, and i has a problem when dynamically allocating a large size of memory, the error is access violation to memory. the answer is how can i getride of this problem
Five answers:
vids007
2007-04-11 04:42:20 UTC
Do u deallocate memory (i.e. use free) each time u allocate some ?
AnalProgrammer
2007-04-11 04:45:20 UTC
The access violation error is caused when you access memory that is NOT allocated to the program. This could be caused by a null or zero pointer.



Double check your pointer allocation that it is set to point to the allocated memory.
?
2016-12-20 16:24:01 UTC
I agree we could communicate lower back and forth to get the completed answer to a query. What if we had yet another question some answer that exchange into given, could we initiate a sparkling question? I additionally think of that a great number of folk get flagged by asserting to plenty approximately themself. For confidentiality. Sorry, I have no answer on your different question. Shhhh...stop conversing, earlier we get in trouble. jk lol
Balk
2007-04-11 04:44:09 UTC
Check for null or bad pointers in your program.

It sounds like your program has a bug where you are trying to access a bad memory location.
2007-04-11 05:12:42 UTC
Post the buggy code so we can take a look.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...