Question : How to acces C function calls in iPhone development

I would like a code example of how to access the c function calls that are found in the LibSystem library from within in an iPhone application.

Thanks

Answer : How to acces C function calls in iPhone development

Same way as in the standard C.
You need to add this library to your project. You need to include the h-file with the function signature. Now you can call this function.

I attached a short program that uses sscanf.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
#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;
}
Random Solutions  
 
programming4us programming4us