954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

getting null pointer assignment error

Hi guys!!!

This is my first post on daniweb & i hope i find a solution to my problem.I am developing a software that makes extensive use of Matrices.i have used dynamic memory allocation for matrices.Now this program makes lots of iterations.It works upto certain iterations say 56 after which it halts giving null pointer assignment error.Its giving the same message on same iteration regardless of teh values that i am entering.I think its happening because the memory is exhausted.but i am not sure.wht do u intelligent people think???I am very new at this field & need your help.
Plzzzzzzz help me.Is it a good idea to attach my program with this msg???soembody please help this confused soul.:sad: :?:

Harshita_garg
Newbie Poster
10 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

Hard to tell with your limited explaination. There are some things you can do to see if it is really exhausting memory.
You can check the memory pointer to which memory allocated is assigned using malloc or new. use the condition the memory pointer is NULL for malloc or in the case of new, you can use this technique. Most probably you are trying to access a invalid location. Try to use your debugger ( you know how to use it don't you ) and see at what part of your program does this occur.

Another way to determine if memory is really exhausted it by looking at the task manager if you are using windows. if you can see that the memory usage increases upto its maximum limit and fails while you execute the program, that means the memory is exhausted. If not, then you are doing something else wrong.

WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 
Hi guys!!!


HI!Is it a good idea to attach my program with this msg??? Generally, yes. Be sure to read this about Code Tags .

Also, in English, sentences end in a period which is then followed by a space. Don't write them like a web address.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Do you have memory allocation check? Implement it then you will be shore is that your problem or not.

andor
Posting Whiz in Training
276 posts since Jun 2005
Reputation Points: 251
Solved Threads: 29
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You