this is all good but guys i need to access the arrays like
a static array and not with pointer referencing
like i need to access A with A[][][][].Please is there someone who can
suggest a technique.there have been many qs asked as to why i need the
array ,what about the memory,FAQs i need to read.I thought i can get
some real help here.Is there no one who can actually solve the
problem.Why is there a need to give an alternate solution.I dont
require alternates.This is the problem plain and simple i have a to
declare a 4 dimensional dynamic array and need to then aces it like a
static array with normal array indices like a[][][][] and not
*A(i*j*k).I know the compiler treats it the same .But i need the access
to it through A[][][][].Please anyone.I would really appreciate a
solution then some condesecnding remarks or an alterante solution.
Thanks,
Barry Schwarz wrote:
On Tue, 30 May 2006 12:50:17 -0400, Eric Sosman <Er*********@su n.com>
wrote:
vi************ @gmail.com wrote On 05/30/06 12:46,: Hey,
Okay i havent written that correctly.There arent 2 arrays.I just want
to declare a dynamic array A[31][130][256][256] and access it with
indices like i would a static array.
SomeType (*A)[31][130][256][256];
A = malloc(sizeof *A);
if (A == NULL)
abort();
A[1][2][3][4] = 42;
I'm sure you really meant
(*A)[1][2][3][4] = 42;
Remove del for email