C question for you old guys ;-)
C question for you old guys ;-)
- Subject: C question for you old guys ;-)
- From: David Cairns <email@hidden>
- Date: Sun, 8 Jun 2003 14:58:38 -0400
hey all, here's my problem --
i've defined:
typedef struct {
int x, y;
} sprite;
sprite *spriteInfo;
in my .h file. in the -init method in the .m, i call:
spriteInfo = malloc(sizeof(sprite));
if(spriteInfo == NULL) return nil;
and it always returns nil!
i've also tried using spriteInfo = calloc(1, sizeof{sprite)); but the
reults came out the same.
I stuck a little NSLog(@"%i", (int)sizeof(sprite)); in there, so i know
that im not ~completely crazy...
any suggestions?
thanx, dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.