/* Demonstration of parameter modification. */ #include #include void modparms (int i, char buf[]); /* modparms will attempt to alter the value of both its arguments. */ main () { int k; char strng [100]; k = 27; strcpy(strng, "First name"); printf("Before modparms, k==%d, strng==%s.\n", k, strng); modparms(k, strng); printf("After modparms, k==%d, strng==%s.\n", k, strng); } void modparms (int i, char buf[]) { printf(" Start of modparms, i==%d, buf==%s.\n", i, buf); i = 999; strcpy(buf, "different"); printf(" End of modparms, i==%d, buf==%s.\n", i, buf); }