Skip to main content

All Questions

0 votes
0 answers
63 views

Why do we use a single pointer rather than a double pointer to pass an array to a function? [duplicate]

Why not double pointer to take an array? I'm having a bit of problem understanding why an array isn't passed as a double pointer (a pointer to a pointer) since the array name itself is a pointer (...
Hannibal.Br's user avatar
1 vote
3 answers
63 views

How does this code allocate memory and why does it fail to write to the allocated memory?

Why does the code below compile successfully but fail to write memory other than address 0? (compiled in dev-cpp 6.3) #include <stdio.h> #include <stdlib.h> void alloc_arr(int **d_ptr); ...
minhaz hosen's user avatar
0 votes
1 answer
100 views

Double pointer with array in another function

I have to create a program that has an array of costumers (structs that contain name, code and documentation) and functions to insert, remove and list all of them in order of code. I'm not ...
Pedro R.'s user avatar