I am confused, while debugging code I am facing with some weird value 3440 for my int struct members. For example here is one function
struct Node
{
int ptrCounter;
void *value;
struct Node *next;
};
typedef struct Node *Node;
struct SL
{
Node front;
CompareFunction compare;
DestroyFunction destroy;
};
typedef struct SL* SLPtr;
SLPtr SLCreate(CompareFunction cf, DestroyFunction df)
{
SLPtr slp = (SLPtr)calloc(1, sizeof(SLPtr));
Node frontNode = (Node)calloc(1, sizeof(Node));
frontNode -> ptrCounter = 1;
frontNode -> value = NULL;
frontNode -> next = NULL;
slp -> front = frontNode;
slp -> compare = cf;
slp -> destroy = df;
return slp;
}
When I am standing on the breakpoint at (return slp;) I see that my (frontNode -> ptrCounter;) has value 3440. Why is it so? Thanks