Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!psuvax1!psuvm!cunyvm!uupsi!pinet!reg From: reg@pinet.aip.org (Dr. Richard Glass) Newsgroups: comp.lang.c Subject: Re: pointer problems, help! Message-ID: <1991Mar22.191215.18659@pinet.aip.org> Date: 22 Mar 91 19:12:15 GMT References: <1991Mar22.082225.24948@bronze.ucs.indiana.edu> Distribution: na Organization: American Institute of Physics Lines: 22 The answer is that your structure definition contains pointers that do not have valid rvalues to de-reference (PPRL) (pointers pointing to random locations). The value of these pointers are random memory. In this case, most likely to the same address do to your results. On some systems, a runtime error could be produced sometimes - other times - who knows. The fix here is to either re-define the fields of the structure to be arrays or allocate the various fields ex: target_player.first_name = malloc(the_size_U_need_to_hold_name +1) The bug here is equivalent to the following piece of code: foo() { char *random_pointer; strcpy(random_pointer,"Hello world"); } Ricky Glass reg@pinet.aip.org