Thursday, July 30, 2009

How can uninitialised ponters in c++ cause system to crash?

I dont know why do you need to uninitialize.


But fact is that pointer will be pointing somewhere at any instance. What you can do is to make sure it should not point to your data..





Un-initialization of pointers .... i feel its not exactly possible..


may be you can the value which it is pointing to null. But pointer will be pointing somewhere always..


-PC

How can uninitialised ponters in c++ cause system to crash?
It will cause your program to crash, not your system (unless you are writing operating system code, then your OS could die violently).
Reply:A pointer is a reference to a location in memory. If the pointer is uninitialized, it will point to a random location in memory and the program will try to access the wrong data. In the worst case, the program can change the incorrect information. If the information belongs to windows or another program, the computer will crash!





Oh, and don't wait until Sunday night to do your homework next time!
Reply:i am not think so Uninitialised pointers made to system crash





in gentral pointer to point and main memory address


if we uninitialised the pointre i will point any where else


if made to null it ponit nothing





if in loop to make null of and move the pointer


it may cause system crash





because in main memory only current os and files will loaded


it make all the data to be null





it may cause system crash


No comments:

Post a Comment