delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/08/11:01:05

From: Jeramie DOT Hicks AT mail DOT utexas DOT edu (Jeramie Hicks)
Newsgroups: comp.os.msdos.djgpp
Subject: New pointer methods being taught
Date: Mon, 08 Mar 1999 15:48:33 GMT
Organization: The University of Texas at Austin, Austin, Texas
Lines: 21
Message-ID: <36e3ef76.57929301@newshost.cc.utexas.edu>
NNTP-Posting-Host: dial-109-4.ots.utexas.edu
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In my day (many moons ago), you either had a variable, or a ptr to a
variable. If you needed the address of the variable, you used an & to
get it... but that always occured either in function calls (for
functions that wanted a ptr to a variable as an argument) or on the
right side of an equal sign.

I've been having coworkers ask me questions about C programming
lately, and I've been kind of suprised at what their professors are
teaching to them. For instance, I saw several times things like:

char& a; // or
&b = 5; // etc...

being taught to do simple routine operations. Since I've NEVER used an
amperstand on the left side of the equal sign, what's going on here?
What do these statement do?  What's the advantage to doing something
like this? It just seems more confusing then when I learned it, and
they're still doing the same old simple operations, just in a wierd
way.

- Hicks

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019