#include <cstdio> #include <cstring> const int Len = 80; struct Names { char given[Len]; char family[Len]; }; void EditNames(Names &n); Names GiveNames(); int main() { Names N = { "try", "this" }; printf("%s,%s\n", N.given, N.family); strcpy(N.given, "me"); strcpy(N.family, "too)"; printf("%s,%s\n", N.given, N.family); EditNames(N); printf("%s,%s\n", N.given, N.family); } void EditNames(Names &n) { strcpy(n.given, "changed)"; strcpy(n.family, "both"); } |