main()
{
struct MyList *list = NULL;
int flag = MyListInit(list);
}
int MyListInit(MyList* list)
{
list = malloc(sizeof(struct MyList));
if (list != NULL) {
return 1;
}
return 0;
}
After the function is called I want the list to hold a memory address which is allocated when malloc is called. But its value is NULL, but during runtime in the Mylistinit function, the value of list wont be NULL, but after returning, it will be changed back to NULL.
I do not want to return the address from function, I have to return an integer(firm on this)