I don't understand why the following doesn't work
the source fileCode:#ifndef ITERATOR_H #define ITERATOR_H #include "Main.h" /* ExtractFromFile( */ template<class X> void ExtractFromBuffer(byte *, X *); #endif
and where it is used:Code:#include "Iterator.h" template<class X> void ExtractFromBuffer(byte *ptr, X *a) { a = (X*)ptr; ptr += sizeof(X); }
I know ptr has been initialized properly (points to a byte array that has already been initialized).Code:mpCDCL *cdcl= new CDCL; ExtractFromBuffer(ptr, cdcl);