Created
June 8, 2015 02:19
-
-
Save danish-rehman/6f1a1ac1b63aead33c62 to your computer and use it in GitHub Desktop.
Simple_mail_struct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Inefficient way */ | |
struct email { | |
time_t send_date; | |
int flags; | |
int length; | |
char body[EMAIL_BODY_MAX]; | |
}; | |
struct email *email = malloc (sizeof (struct email)); | |
/* This size is fixed and not dependent on the caller */ | |
email->length = 12 + EMAIL+BODY_MAX; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment