Talk:C:Pointers and References

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

C does have references as well. Passing references to functions works a bit different though. I don't have time to reword things right now (going to bed :), but I thought I should leave a note here either for someone to fix or for me to fix later. - sik0fewl 00:37, 26 Jan 2005 (EST)

References in C? I'm puzzled... elaborate! --Marijn
Okay, I'm only half right.. it was late when I wrote that and I was tired :) What I was thinking was that you can pass values to functions by reference (ie, pass the address instead of the value). But I guess C doesn't have reference variables like C++ does (which is what the article is talking about), so I guess the wording is fine. I'll try to go to bed earlier tonight :) - sik0fewl 10:26, 26 Jan 2005 (EST)

There no references in C as there are in C++ - I suggest you rename the section accordingly. And maybe there should be two separate sections, one about differences and similarities between pointers and references in C++, and another about pointers in C (and C++ as well).

Red Heads

"Most pointers have a type associated with them, but there is a special pointer, a red-head in the group, called a void pointer (void*)." Couldn't that be "black sheep" or something? Red heads aren't particular rare, and that is a bit hairist in my opionion.