Re: hash problem with NSString
Re: hash problem with NSString
- Subject: Re: hash problem with NSString
- From: Nat! <email@hidden>
- Date: Mon, 27 Sep 2004 23:49:55 +0200
Am 27.09.2004 um 22:05 schrieb Eric Ocean:
Okay, here is code that demonstrates the problem *(might not really be
a problem though--see below):
But mysteriously this code
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
const char char_array[5] = { 'R', 'o', 'o', 't', '\0' };
NSString *a = [NSString stringWithCString:&char_array length:5];
NSString *b = [NSString stringWithCString:&char_array length:strlen(
char_array)];
NSString *c = @"Root";
NSLog( @"Hash: a=%X b=%X c=%X", [a hash], [b hash], [c hash]);
[pool release];
return 0;
}
returns
2004-09-27 23:48:22.489 hash_really_broken_question[2466] Hash:
a=889E36C9 b=9B749F28 c=9B749F28
Ciao
Nat!
------------------------------------------------------
A good dog, though a fool.
Who wants a smart dog! -- R.A. Lafferty
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden