I need a way to search through a block of memory for a char[2] array
"DA" using a pointer to a short. Ideally I would like to write
something like:
short *data = ... some data...;
int j = 0;
while( data[j] != *((short*) "DA") ) j++;
But this doesn't work. The char[2] obviously has an equivalent 16-bit
value so how do I get that info in a simple way?
"DA" using a pointer to a short. Ideally I would like to write
something like:
short *data = ... some data...;
int j = 0;
while( data[j] != *((short*) "DA") ) j++;
But this doesn't work. The char[2] obviously has an equivalent 16-bit
value so how do I get that info in a simple way?
Comment