Why is it that when I store the DATA of a double value in a char array if I get the data from the char array to another double, it returns a Float value?
In this:
double vals = 3.141592654;
char xvals[sizeof(vals)];
memcpy(&xvals, &vals, sizeof(xvals));
double y;
memcpy(&y, &xvals, sizeof(xvals));
std::cout<<y<<"\n";
OUTPUT: 3.14159