avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Dynamic memory


From: Victor Sluiter
Subject: [avr-gcc-list] Dynamic memory
Date: Wed, 19 Dec 2001 14:27:13 +0100 (MET)

Hello everybody,

For some days I've been trying to use dynamic memory allocation on an
ATMEGA103. The first tests looked promising, but now I'm stuck. I have something
like this structure:

struct test{
        char a1;
        char a2;
        struct test *nxt;
        struct test *prv;
};
I can link structures by making new structs with malloc(), and linking the
'prv' from the new struct to the last in the line, and the 'nxt' from this
last to the new one. If I take a look at things like pTest->a1, or
pTest->prv->prv->a1 (where pTest is a struct test *)everything works right, so 
the
'structures' are properly linked! The problem is: I would like to scroll through
this list, but when I try to do something like pTest = pTest->prv , the result
is that pTest stays exactly the same....
Anyone got an idea what might be going on? Thanks in advance for any help at
all!

Greetings, Victor




-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]