tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Why memcpy is imported ?


From: Stephan Beal
Subject: Re: [Tinycc-devel] Why memcpy is imported ?
Date: Fri, 21 Feb 2014 15:38:10 +0100

On Fri, Feb 21, 2014 at 3:27 PM, Jens Nyberg <address@hidden> wrote:

No, if you think about it a structure is like a tiny buffer. The only way to copy that is by using memcpy. This is why

Structs support bitwise copying without memcpy() (though perhaps it is used internally to implement this), provided the size is known:

struct foo s1;
struct foo s2;
s1.x = ...;
s1.y = ...;
s2 = s1;
assert(s2.x == s1.x)

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

reply via email to

[Prev in Thread] Current Thread [Next in Thread]