I have allocated memory of 100 MB using malloc
block = (char *)malloc(sizeof(10485760)); // char *block is a global variable
and then I assigned value in block to some local variable say localblock
char *localblock = block;
when I tried to access location after 1 MB and copying string in that location im getting access violation error
int si = 1048576;
for (int i=0; i < si; ++i)
++localptr;
strcpy(localblock,"random_string");
<--- im getting error here .please help me