http://geeksquiz.com/c-pointers-question-12/
On Sat, Jan 12, 2013 at 9:18 PM, Piyush Raman <[email protected]>wrote: > For simple reasons according to me: > 1- It reduces overhead drastically,thus more efficient execution time is > achieved. Consider a recursive function call having array parameters -> > func (int a[100][100], int b[100][100]).. Now instead if we use pointers-> > func(int **a, int **b), the overhead on the stack of the language decreases > drastically and thus further reducing the execution time of the code!! > > 2- It allows dynamic memory storage. If you do not know the amount of > memory needed, then using dynamic allocaton using pointer is the best way. > Consider we have an array -> arr[1000], but we actually need to use only > 10,5, or even 2 sized array! This will lead to huge memory wastage.. > instead we can do size_type *arr= new size_type[size]. thus this leads to > more space efficient code and avoid chances of memory overflow. > > 3- Access to an entity via pointer is faster!! :P > Hope this helps! > > > On Thu, Jan 3, 2013 at 7:49 PM, Debabrata Das < > [email protected]> wrote: > >> @ arun... 8 byte may be for 64 bit application or far pointer ... >> >> On Thu, Jan 3, 2013 at 6:29 PM, Arun Vishwanathan >> <[email protected]> wrote: >> > @atul/shady: why is it that pointer takes 8 bytes ? So the takes a >> memory >> > location whose value is the address of the element it points to. Why >> does >> > the pointer value have to take 8 bytes? I am sorry if I am missing >> something >> > silly here. >> >> -- >> >> >> > -- > > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
