You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
296 B
Objective-C
22 lines
296 B
Objective-C
#import "Test.h"
|
|
#include <string.h>
|
|
|
|
@implementation NSConstantString (Test)
|
|
- (unsigned int)length
|
|
{
|
|
return length;
|
|
}
|
|
- (const char*)cString
|
|
{
|
|
return str;
|
|
}
|
|
@end
|
|
|
|
|
|
int main(void)
|
|
{
|
|
assert([@"1234567890" length] == 10);
|
|
assert(strcmp([@"123456789" cString], "123456789") == 0);
|
|
return 0;
|
|
}
|