Welcome! Log In Create A New Profile

Advanced

10 years

Posted by TraceyB 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Re: 10 years
January 02, 2009 03:53PM
definitely agree grinning smiley

c/c++ is actually quite evil sometimes, and will let you do something like

static s_clockTime = 0.-f;

// ...

s_clockTime += dt;

without even giving a single warning!
avatar Re: 10 years
January 04, 2009 07:26PM
lycium Wrote:
-------------------------------------------------------
<snipped>
> besides this there is only the syntactic
> difference between references and pointers...
>

No, there is not. A pointer is a variable that can hold an address to memory. A
reference is the address of an object in memory. Hence, a pointer can have arithmetic
performed on it, and can point to nothing at all, while a reference cannot support
arithmetic operations and always has to be valid (cannot have a reference to "nothing",
like a pointer to "NULL" or a reference to anything, like a pointer to "void"winking smiley.

The only similarity I can see is that taking the address of a variable results in both a
pointer and a reference, whichever you would like.
avatar Re: 10 years
January 05, 2009 11:45AM
maybe read the part you snipped
Re: 10 years
January 05, 2009 12:20PM
avatar Re: 10 years
January 05, 2009 01:15PM
lycium Wrote:
-------------------------------------------------------
> maybe read the part you snipped

Okay

lycium Wrote:
-------------------------------------------------------
> all the crazy things you can do with pointers are probably not a good idea for
> general (non-performance oriented) software development,

Now, what relevance has this to my explanation that the difference between pointers
and references is deeper than mere syntax?
Sorry, only registered users may post in this forum.

Click here to login