| What are the disadvantages of ... | |||||||
|
30 Day Risk-Free Guarantee:
100% money back if you're unsatisfied. Book (308 Pages):
![]() Video (One Hour):
![]() Resume Review (24 - 48hr)
All Products / Services
|
|||||||
Above answers are not impressive at all, even though I reluctantly was to accept them as correct in the first place.
Using pointers causes an additional level of indirection to access data. Makes access slow.
It is relatively harder to debug pointer arithmatic code and write access to data involving multiple pointers.
On a better side, it is impossible to write memory efficient programs without pointers.
Your thoughts below:
1. Debugging is more harder as compare to normal code.
2. Coder need to be more careful while writing the code , otherwise it produces memory leak etc.
Be careful about dangling pointers case. If u dnt set the pointer to NULL after mem_free then later in p != NULL check will not be useful and later on the same pointer can cause memory corruption which is very hard to debug.
The number of errors in a program are directly proportional to the number of pointers used in the program - Yahswant Kanitkar (Author of one of the best books -Pointers in C)
But on a more serious note, usage of un initialize pointers can cause an application to crash. I guess this is the single biggest disadvantage...
Some of the disadvantages are:
1. you can change the value of the const variable.
2. private variable of a class can be changed.