1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <stdio.h> struct data{ char array[20]; }; void print(struct data d){ printf("%s", d.array); } int main(){ struct data d; sprintf(d.array, "hello world"); print(d); return 0; }
1
hello world