Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Randomizing Linked list addresses

Status
Not open for further replies.

kaushikrvs

Member level 5
Joined
Jan 27, 2017
Messages
82
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
613
My malloc is allocating consecutive addresses. I want my linked list next address to be a random address instead of consecutive addresses. I know malloc is hard to control; so i wanted to know how to randomize the pointers in the linkedlist? For exxample ; if link1->next = 0xf8 ; link2->next = oxf9; link3->next = 0xf9; I want to make link1->next = 0xf8 ; link2->next = oxfa ; link3->next = 0xf9
 

One easy trick to obtain random numbers is to grab the contents of a byte of ram which changes continuously. Example, internal time clock.
 

Methods to generate random numbers is one thing but what is the purpose of randomizing the links in a linked list? Surely, the whole point of a linked list is that each entry points the the next in sequence anyway, no matter what address the link actually points to.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top