getting null pointer assignment error

Reply

Join Date: Nov 2006
Posts: 10
Reputation: Harshita_garg is an unknown quantity at this point 
Solved Threads: 0
Harshita_garg Harshita_garg is offline Offline
Newbie Poster

getting null pointer assignment error

 
0
  #1
Nov 8th, 2006
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.
Last edited by Harshita_garg; Nov 8th, 2006 at 12:23 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: getting null pointer assignment error

 
0
  #2
Nov 8th, 2006
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.
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: getting null pointer assignment error

 
0
  #3
Nov 8th, 2006
Originally Posted by Harshita_garg View Post
Hi guys!!!
HI!

Originally Posted by Harshita_garg View Post
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.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 275
Reputation: andor has a spectacular aura about andor has a spectacular aura about andor has a spectacular aura about 
Solved Threads: 29
andor's Avatar
andor andor is offline Offline
Posting Whiz in Training

Re: getting null pointer assignment error

 
0
  #4
Nov 8th, 2006
Do you have memory allocation check? Implement it then you will be shore is that your problem or not.
If you want to win, you must not loose (Alan Ford)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC