In what cases should I use memcpy over standard operators in C++?
When can I get better performance using memcpy or how do I benefit from using it? For example: float a[3]; float b[3]; is code: memcpy(a, b, 3*sizeof(float)); faster than this one? a[0] = b[0]; a[1] = b[1]; a[2] = b[2]; Efficiency should not be your concern. Write clean maintainable code. It bothers me that so many answers indicate that the memcpy() is inefficient. It is designed to be the most efficient way of copy blocks of memory (for C programs). So I wrote the following as a test: #include <algorithm> extern float a[3]; extern float b[3]; extern void base(); int main() { base(); #if