2D array of structures

From: michi (michi_at_fossilgroup.net)
Date: 11/28/04


Date: Sat, 27 Nov 2004 23:09:00 GMT

Hello,

I need to initialize a 2 dimensional square arrays of structures. The size of array I get from the user. I can
do one-dimensional array, but I don't know how to specify the size of array when I want to do it 2D. I want
to do it using 'new' operator.

Thanks, michi.



Relevant Pages

  • Re: compiler bugs
    ... In a language like C, the behavior of programs that reference ... Not if the unoptimizing compiler initializes all variables to some ... portion of the array in your algorithhm. ... that one actually does not need to initialize all variables (unlike ...
    (comp.compilers)
  • Re: Error 216 (related to SetLength)
    ... It might turn out that you're writing to a part of an array that doesn't exist. ... suggests you're talking about an access violation (in which case I'd like to know what addresses the exception reports), but your previous message only quoted the text from a different kind of exception, about changing visibility in OnShow or OnHide. ... I'd even go so far as to argue that OnCreate isn't the right place, ... Since your variables are global, they aren't related to any specific form, so a form isn't what should initialize them. ...
    (alt.comp.lang.borland-delphi)
  • Re: compiler bugs
    ... While I hate disagreeing with you Anton, ... Not if the unoptimizing compiler initializes all variables to some ... portion of the array in your algorithhm. ... being able to not actually initialize the array for the unused ...
    (comp.compilers)
  • Re: behavior-preserving optimization in C, was compiler bugs
    ... initialization is the same with and without optimization. ... initialize to a defined value that also survives, e.g., program ... by zero is in a function that references an uninitialized local array ... changes to register and stack ...
    (comp.compilers)
  • Re: Function lookup tables?
    ... Ignore any typos the source is good except howto initialize the function ... > I want to initialize the function lookup table array to my member ... > function calls of the class inside of the constructor for the class. ... > What is the correct code to initialize the function pointer array ...
    (comp.lang.cpp)