//
// main.m
// The pragramming in Objective-C
//
// Created by 林荣安 on 15/7/28.
// Copyright (c) 2015年 林荣安. All rights reserved.
//
static void calculateAverage(int a, int b, int *c)
{
*c = (a + b);
}
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
int a = 1;
int b = 3;
int f = 4;
int *c = &f;
calculateAverage(a, b, c);
printf("%d\n",*c);
}
return 0;
}
改成这样子就OK的了。。。。。。 |