Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!jfjr@mitre-bedford.arpa From: jfjr@mitre-bedford.arpa (Freedman) Newsgroups: comp.lang.c Subject: Structures and arrays Message-ID: <11342@brl-adm.ARPA> Date: 20 Jan 88 11:48:10 GMT Sender: news@brl-adm.ARPA Lines: 37 id AA19202; Fri, 15 Jan 88 12:15:46 EST Date: Fri, 15 Jan 88 12:15:46 EST From: jfjr (Freedman) Suppose I have the following typedef struct /* I despise structure tags */ { /* some irrelevant field declarations */ char string[80]; int vector [4]; } structure_type; structure_type first_structure,second_structure; /* The various fields of first_structure get filled */ /* and somewhere in the code I do this */ second_structure = first_structure; /* ANSI standard allows this */ Now, tell me about the string and vector fields of second structure. Since they are arrays then the fields are actually pointers. The question is: are the string and vector fields of "second_structure" pointing ad the same addresses as the corresponding fields of first structure or are they pointing to different areas of memory into which the contents of the arrays pointed to in first_structure have been copied(whew - what I meant not what I said)?? Jerry Freedman, Jr "Thank you, folks, jfjr@mitre-bedford.arpa for those kind applause" (617)271-4563