POV-Ray : Newsgroups : povray.off-topic : C++ questions : C++ questions Server Time
10 Oct 2024 00:01:50 EDT (-0400)
  C++ questions  
From: Invisible
Date: 24 Sep 2008 10:17:22
Message: <48da4bf2$1@news.povray.org>
(You knew there were going to be a few at some point...)

I just want to make sure I've got this absolutely straight in my head. 
So... a reference is the same as a pointer, except that it has nicer 
syntax, and you cannot change where it points to?

If I'm understanding this correctly, a "union" is like several structs 
with the same base address, and you can treat it was one struct or the 
other struct, and it's up to you to remember which which struct you're 
currently using it is. (I.e., the language itself provides no way to 
distinguish.)

Here's a perverse question: can a union have member functions?

My understanding is that when you create variables, they start off 
containing junk unless you initialise them (or their types have 
constructors which initialise them to something specific). Is that correct?

Does C++ have a concept of a "null pointer" - i.e., a pointer that 
doesn't point to anything valid, and can be detected as such?

How does memory allocation work in C++? If a program fills the heap, do 
you have to explicitly *do* something to enlarge the heap, or does it 
grow automatically? Does it shrink back again after you release things, 
or do you have to request that manually?

There will probably be more questions as I read further. Currently I'm 
still attempting to comprehend the concept of a "const volatile variable"...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.