944,124 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3057
  • C RSS
Nov 8th, 2006
0

getting null pointer assignment error

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Harshita_garg is offline Offline
10 posts
since Nov 2006
Nov 8th, 2006
0

Re: getting null pointer assignment error

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.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Nov 8th, 2006
0

Re: getting null pointer assignment error

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.
Moderator
Reputation Points: 3281
Solved Threads: 895
Posting Sage
WaltP is online now Online
7,748 posts
since May 2006
Nov 8th, 2006
0

Re: getting null pointer assignment error

Do you have memory allocation check? Implement it then you will be shore is that your problem or not.
Reputation Points: 251
Solved Threads: 29
Posting Whiz in Training
andor is offline Offline
274 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Program For Rsa
Next Thread in C Forum Timeline: XOR Encryption





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC