Re: learning dragonfly or C...

看板DFBSD_kernel作者時間21年前 (2004/11/11 17:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/23 (看更多)
On Thu, 11 Nov 2004, Devon H. O'Dell wrote: > The statement: > > vpp = &vp > > is ``dereferencing'' vp. Dereferencing effectively provides the address > in memory of a variable. > modfunction(int *bar) > { > > *bar = 3; /* Change bar to 3 */ > printf("%d\n", *bar); > return; > } > modfunction(&foo); > This time, we ``dereferenced'' our variable foo (and, on a sidenote, I > don't know why it's called dereferencing, I think it's a horrible name > and substitute it mentally with ``grab the address of'' whenever I see It's called dereferencing because a pointer is a reference to something, and dereferencing is the act of doing away with the reference (de-referencing) and handling what is actually pointed to instead. So the opposite of what you said really. Did you get enough sleep tonight? :-) (but *bar = 3 in modfunction() is dereferencing bar though, if that's what you meant.) I have no idea what the opposite operation (&) is called. Referencing? Nah.. Magnus
文章代碼(AID): #11ap6N00 (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #11ap6N00 (DFBSD_kernel)