Malloc on a Pointer Parameter Failing
问题 I have the following lines of code: struct c_obj_thing *object = NULL; c_obj_initalizer(object); // at this point, (object == NULL) is 'true' printf("Value: %d\n", object->value); // this segfaults Here is the definition for c_obj_initalizer: int c_obj_initalizer(struct c_obj_thing *objParam) { objParam = malloc(sizeof(struct c_obj_thing)); objParam->pointerThing = NULL; objParam->value = 0; return 0; } Why does the malloc in the c_obj_initalizer method not stay attached to the pointer passed