Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct date {
- char day[80];
- int month;
- int year;
- };
- //Error a value of type "void*" cannot be used to initialize an entity of type "date*"
- struct date *object=malloc(sizeof(struct date));
- strcpy(object->day,"Good day");
- object->month=6;
- object->year=2013;
- FILE * file= fopen("output", "wb");
- if (file != NULL) {
- fwrite(object, sizeof(struct date), 1, file);
- fclose(file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement