iPhone/Objective-C struct question my own CGRectZero
- by Mark
I am designing a Padding struct as follows:
/* Padding. */
struct CGPadding {
CGFloat left;
CGFloat top;
CGFloat right;
CGFloat bottom;
};
typedef struct CGPadding CGPadding;
CG_INLINE CGPadding CGPaddingMake(CGFloat left, CGFloat top, CGFloat right, CGFloat bottom) { CGPadding p; p.left = left; p.top = top; p.right = right; p.bottom = bottom; return p; }
This all works perfectly well, the problem is how can I create a const CGPadding CGPaddingZero? If I do like this:
const CGPadding CGPaddingZero = (CGPadding){0.0, 0.0, 0.0, 0.0};
It doesnt work. So what am I doing wrong?