Look at the comments please.
Code:
#include <stdio.h>
#define MAXLEN 20
struct proto_type {
int i;
char s[MAXLEN];
};
main() {
struct proto_type stru_1, *p;
int i;
p = &stru_1;
for (i = 0; i < MAXLEN-1; i++)
(&stru_1)->s[i] = '0';
(&stru_1)->s[i] = '\0'; /* necessary when using (&stru_1)
to access a member in a structure */
printf("before:\n%s\n", (&stru_1)->s);
for (i = 0; i < MAXLEN-1; i++)
p->s[i] = '0';
/* p->s[i] = '\0'; */ /* unnecessary when using pointer 'p'
to access a member in a structure */
printf("after:\n%s\n", (&stru_1)->s);
}