Malloc()
Malloc()
- Subject: Malloc()
- From: Jason Moore <email@hidden>
- Date: Tue, 2 Apr 2002 00:49:32 -0600
Hello all.. Sorry to keep bothering everyone with C questions, but this
one has me totally stumped..
I need to pass some data (in the form of a char* buffer) into a Unix
library function. I'm getting my data from an NSData object using
GetBytes:range:. My problem is that my buffers are not working.
i have:
char *buffer;
buffer = malloc(bufferSize);
NSLog(@"buffer size is: %i", sizeof(buffer));
here is where the problem is. the log output is 'buffer size is: 4',
even when i change the malloc
statement to read buffer = malloc(129) (129 is the size of the buffer i
need in my test case).
any ideas?
thanks in advance.
jason
_______________________________________________
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.