如何在构造函数中设置指向 C 数组的指针?
@implementation NSBufferedInputStream {
char *buffer;
int bufferSize;
}
- (id)initWithFileAtPath:(NSString *)path
{
self = [super initWithFileAtPath:path];
if (self) {
bufferSize = 100;
buffer = char[bufferSize]; // ERROR: Expected expression
}
}
@end