Created
July 2, 2015 05:11
-
-
Save devendranaga/c1d349b1615397e2b559 to your computer and use it in GitHub Desktop.
reset struct without using memset
This file contains 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
#include <stdio.h> | |
struct test_ { | |
int a; | |
char string[20]; | |
}; | |
int main(void) { | |
struct test_ test_ = {}; | |
printf("%d %s\n", test_.a, test_.string); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment