cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
What does & in front of a function argum
What does & in front of a function argument mean?
Jan 20, 2010 at 1:18pm UTC
Zyprexa
(2)
Hi
I have this function:
EventGetUserId(Event, &userID);
userID is an (unsigned int) variable, but what does the & in front of it mean/do?
Jan 20, 2010 at 1:31pm UTC
Bazzy
(6281)
It returns the memory address of userID
see
http://www.cplusplus.com/doc/tutorial/pointers/
Jan 20, 2010 at 1:33pm UTC
kbw
(9488)
It means, pass the address of userID rather than pass its value. We call this pass by reference. It allows EventGetUserId to change the value of userID.
Jan 20, 2010 at 1:35pm UTC
Zyprexa
(2)
Thanks
Topic archived. No new replies allowed.