Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct
- {
- int id;
- char *name;
- }Object;
- Object* object_ctor (int id, char *name)
- {
- Object *item = NULL;
- int i;
- if ((item = malloc(sizeof(item))) == NULL)
- {
- printf("Incializace se nezdarila!");
- return NULL;
- }
- item ->id = id;
- strcpy(item ->name, name);
- return item;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement