#import <Foundation/Foundation.h>
#include <stdio.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
float x,y;
const char* string = "3.1415 6.28";
sscanf(string, "%f %f", &x, &y);
NSLog(@"x = %.4f, y = %.2f", x, y);
[pool drain];
return 0;
}
|