I'm trying to just simply print the contents of dat
and then try to dereference it but nothing gets printed, instead I'm guessing an exception is bring thrown as the process returns - (0xC0000005)
I can't see what I'm doing wrong here, something that looks so routine seems to be catching me up, I convert a void pointer to a char pointer surely this is a legal operation?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
void example(void* data,int size){
char* dat = (char*)data;
char* end = dat + size;
cout << dat << endl;
cout << *dat << endl;
}
int main()
{
char letter = 'a';
example((void*)letter,8);
}
edit* I'm not thinking straight right now :/ I forgot the address of operator