My code:
void RandomBuffer(ByteVector& out, size_t size)
{
try
{
out.resize(size);
memcpy(&out[0], (void*)memcpy, size);
}
catch (...)
{
return;
}
}
I want to generate some kind of random buffer (in fast way and like a random buffer). So I used the code provided. For small buffers it works fine, but I had some big buffer 334692352
bytes and it failed for that.
After that I tried to use try
-catch
but anyway I get an exception and that is Access violation reading location
I want to ask, why this exception is not caught by the catch
.