| | |
getting null pointer assignment error
![]() |
•
•
Join Date: Nov 2006
Posts: 10
Reputation:
Solved Threads: 0
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.
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.
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.
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.
バルサミコ酢やっぱいらへんで
HI!
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.
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
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
![]() |
Similar Threads
- Error:Null Pointer assignment (C++)
- In which case "Null Pointer Assignment" will be displayed on the output ?? (C)
- Why this C code is returning Null Pointer Assignment as output (C)
- Null Pointer? will this code work (C)
Other Threads in the C Forum
- Previous Thread: Program For Rsa
- Next Thread: XOR Encryption
| Thread Tools | Search this Thread |
#include * adobe ansi array asterisks binarysearch centimeter changingto char character cm convert copyimagefile cprogramme creafecopyofanytypeoffileinc database dynamic execv feet fgets file floatingpointvalidation fork function getlogicaldrivestrin givemetehcodez global grade gtkwinlinux hacking histogram ide inches include incrementoperators infiniteloop input interest intmain() iso kernel keyboard kilometer license linked linkedlist linux list locate looping lowest matrix meter microsoft mqqueue number oddnumber opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc process program programming radix recursion recv recvblocked research reversing segmentationfault sequential single socket socketprograming socketprogramming standard strchr string suggestions systemcall test threads turboc unix urboc user variable voidmain() wab whythiscodecausesegmentationfault windowsapi






