Pointer Disadvantages

What are the disadvantages of using pointer in C?

Questions by kakarukoireng

Showing Answers 1 - 9 of 9 Answers

1.) If sufficient memory is not available during runtime for the storage of pointers, the program may crash (least possible)
 2.) If the programmer is not careful and consistent with the use of pointers, the program may crash (very possible) Read more:

  Was this answer useful?  Yes

In general, there's no good way to know if a non-NULL pointer value is valid and refers to an area of memory that's safe to access and/or modify.

There's no way to determine from the pointer value itself how large a region of memory that pointer refers to (i.e., whether it's pointing to a single instance of type T or to the first element of an array of T). 

In general, there's no good way to know if a pointer value points to something with static, auto, or dynamic extent.  If you know exactly how your memory model works you can make an educated guess, but that requires some intimate knowledge of the execution environment. 

  Was this answer useful?  Yes

Satarupa Panda

  • Nov 17th, 2011
 

If sufficient memory is not available during runtime for the storage of pointers, the program may crash.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions