[ROOT] how to assign a void pointer to a structured pointer in ROOT(3.03/09)

From: ozgur cobanoglu (ozgur_cobanoglu@hotmail.com)
Date: Mon Mar 24 2003 - 17:22:19 MET


Hello,

how can I assign a void pointer to a structured pointer in a ROOT session? 
When I do below and try to get the
variables declared in the structure, it gives me crazy numbers; I am using 
an external library (libmonitor.so,
libshift.so) to load the file and first I must load (the library, very 
first) the file and get its start point by a void pointer
-this is the only way in my case- after that I must assign it to a variable 
that has embedded structure like that :

...
// headers are included, *.so files are loaded

struct DATEevent {    // embedded structure
   struct eventHeaderStruct header;    // ordinary structs
   struct equipmentStructMy payload;
  };

void* ptr;
struct DATEevent* event;
// here, make the pointer 'ptr' point the start of file in memory
event = (struct DATEevent*)ptr;

printf("%08x \n",event->payload.whatever.whatever.array[5]); // which is a 
specific number like da1e5afe
...

When I use this in an ordinary c++ source it is working. What is the problem 
with this code ?..

Thank you.

(pentium 3, linux7.2, ROOT 3.03/09)

--
----------------------------------------------------------------
Ozgur Cobanoglu           E-posta: ozgur@nucleus.istanbul.edu.tr
Istanbul Universitesi     Tel:     0090-212-511-84-80
Nukleer Fizik Bolumu      Fax:     0090-212-519-08-34
Vezneciler Istanbul       Mobil:   0090-505-512-72-90
34459 Turkiye
----------------------------------------------------------------
Ozgur Cobanoglu          E-mail:   Ozgur.Cobanoglu@cern.ch
CERN EP/AID              Tel:      +41 (22) 767 2382
CH-1211 Geneva 23        Fax:      +41 (22) 767 9585
Switzerland              Building: 53-R-024
----------------------------------------------------------------





_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET