* Problems with malloc()
@ 1995-12-07 1:27 Thomas Auer
0 siblings, 0 replies; only message in thread
From: Thomas Auer @ 1995-12-07 1:27 UTC (permalink / raw)
To: tru64-unix-managers
hi there,
I have a problem with a small c program. The following instruction
returns a pointer to (void *) 0x140024800
32 if ((allocMem = (void *) calloc(nrOfElems,size)) == NULL)
33 {
34 printf("ERROR ALLOCATING MEMORY\n");
35 exit(1);
36 }
but later, on, I try to access th 88th element of my array, which is
located at
(gdb) print curElem
$3 = (t_point *) 0x14002a000
(gdb) print *curElem
Cannot access memory at address 0x14002a000.
which is exactly the address of the 88th element, and since the malloc did
not return NULL, I assume that the allocation worked.
Sorry if that qeustion might not be specific to the alpha architecture,
but I can't find anything wrong in the code, and unfortunately It won't
compile on our other machines.
thanx for your help,
tom
--
* Thomas Auer | Think where man's glory most begins and ends. *
* tom@cosy.sbg.ac.at | And say my glory was I had such friends. *
* Univ. of Salzburg, | William Butler Yeats *
* AUSTRIA | http://www.cosy.sbg.ac.at/~tom/tom.html *
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-12-07 1:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-12-07 1:27 Problems with malloc() Thomas Auer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox