Quote:
Originally Posted by Tango Issac Debian View Post
Will I need to malloc for this structure heap sepratately in the main function? How it will be ?
Providing you put it between the definition and the first use it doesn't really matter where you put it. The statement will be something like:

Code:
heap=(heap*)malloc(sizeof(heap));
Of course, if you're simply doing
Code:
heap *heap;
heap=(heap*)malloc(sizeof(heap));
in the same function, unless there's a specific reason for using pointer semantics then you may as well replace this with
Code:
heap heap;