Memory allocation in D (noob question)

mandel oh at no.es
Fri Nov 30 22:17:25 PST 2007


It probably is a noob question,
but aren't array lengths just hidden size_t values
that are passed around?
Why do we need to allocate space for them, too?

voif foo()
{
  size_t length;
  char* ptr; //allocated memory of 2^n
  //.. the same as..?
  char[] data;
}



More information about the Digitalmars-d mailing list