13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#import <string.h>
#import "OFString.h"
int
main()
{
OFString *s1 = [OFString new:"foo"];
OFString *s2 = [[OFString alloc] init:""];
OFString *s3;
OFString *s4 = [OFString new];
[s2 append:"bar"];
s3 = [s1 clone];
[s4 setTo:[s2 cString]];
printf("s1 = %s\n", [s1 cString]);
printf("s2 = %s\n", [s2 cString]);
printf("s3 = %s\n", [s3 cString]);
printf("s4 = %s\n", [s4 cString]);
[s1 append: [s2 cString]];
|
|
|
|
|
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#import <string.h>
#import "OFString.h"
int
main()
{
OFString *s1 = [OFString new: "foo"];
OFString *s2 = [[OFString alloc] init: ""];
OFString *s3;
OFString *s4 = [OFString new];
[s2 append: "bar"];
s3 = [s1 clone];
[s4 setTo: [s2 cString]];
printf("s1 = %s\n", [s1 cString]);
printf("s2 = %s\n", [s2 cString]);
printf("s3 = %s\n", [s3 cString]);
printf("s4 = %s\n", [s4 cString]);
[s1 append: [s2 cString]];
|