Poi ho notato una cosa, se uso 20*sizeof(SHORT) mi vengono ritornati più di venti caratteri anche se PSHORT pBuffer = new SHORT[20];
se provo a leggere un file testuale dopo aver letto n caratteri la printf mi stampa strani caratteri un printable.
infine ho provato a turno tre diversi modi:
ed entrambi mi sembrano andare bene...ho letto che:codice:// LPSTR pBuffer = new char[20] // PSHORT pBuffer = new SHORT[20] // PBYTE pBuffer = new BYTE[20]
SHORT = A 16-bit integer. The range is –32768 through 32767 decimal.
BYTE = Byte (8 bits).
LPSTR = Pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
se devo fare un buffer che contiene dati binari...quale dovrei scegliere??
grazie



Rispondi quotando