From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Cross Message-Id: <200107060205.WAA21989@augusta.math.psu.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] thread In-Reply-To: <20010706010009.D94AF199C0@mail.cse.psu.edu> Cc: Date: Thu, 5 Jul 2001 22:05:12 -0400 Topicbox-Message-UUID: c326c934-eac9-11e9-9e20-41e7f4b1d025 In article <20010706010009.D94AF199C0@mail.cse.psu.edu> you write: >Hello 9fans, Hey Kenji, >Manual of thread shows the example codes such as: > char m[48]; > ... > {nil, &m, CHANRCV}, >I wonder that &m is a typo. No, &m in this context is perfectly legal C. ``&'' in C says to take the address of the referenced object (m), where m refers to that 48 char array. However, ``m'' by itself will also decay into a pointer to the array, so the two uses are equivalent in this context. At least, that's the gist of it; Doug Gywn would be able to describe it more precisely than I have. As Rob says, though, the & is irrelevant, and I've seen it be confusing in the past; particularly for junior programmers. I recommend writing C code which references arrays without the &. - Dan C.