note 28438 added to language.variables
| From: | gabriel at rack1 dot php dot net | Date: | Mon, 13 Jan 2003 15:26:53 +0000 |
| Subject: | note 28438 added to language.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42060@lists.php.net to get a copy of this message | ||
I know this is not a C++ newsgroup, but I just wanted to get things right, after the comment of
"someone at somewhere dot com".
The C-like piece of code provided by stlawson DOES use a pointer, and NOT a C++ reference.
"someone at somewhere dot com" got confused because type declaration was obviously omitted
for clarity reasons. A reference in C++ is almost a type qualifier: a variable is of type
"reference to objects of class MyClass". Therefore, one cannot assign &myObj to a
variable declared as a "reference to objects of class MyClass". &myObj really
identifies a pointer to myObj, and dereference (using * or ->) is requiered.
--
http://www.php.net/manual/en/language.variables.php
http://master.php.net/manage/user-notes.php?action=edit+28438
http://master.php.net/manage/user-notes.php?action=delete+28438
http://master.php.net/manage/user-notes.php?action=reject+28438