1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h> struct foo { char *str; }; struct foo make_struct(void) { struct foo a; a.str = "string"; return a; } int main() { struct foo b = make_struct(); printf("%s\n", b.str); return 0; } /* end */
1
string