is there any way to move pointer, which is initialized in main()
function, to first executable function and have it accessible in whole program?
Here's the code:
main function, where is pointer d
initialized:
void main(){
int x;
deque *d;
d=(deque*)malloc(sizeof(deque));
initDeque(d);
and I want to move the pointer into function called initDeque()
void initDeque(deque *d){ //Create new deque
d->front=NULL;
d->rear=NULL;
}
Is it possible to move it?