I have the following struct:
typedef struct Graph {
Vertex* x;
struct Graph* next;
int numElts;
}Graph;
And the following code:
void initialize(Graph *x){
x=malloc(sizeof(Graph));
x->size=0;
}
But for some reason the size is later evaluated to not be zero after this call and this call alone on an uninitialized graph object. Is this an issue with pass by value vs. pass by reference? If so, how can this be fixed so that the struct's field is actually modified?