使用OC調用C語言的函數

one.m

#import "two.h"
int main(){

    test();
    return 0;
}

two.h

void test();

two.c

#include <stdio.h>

void test(){
    printf("調用了C語言的函數\n");
}

編譯

cc one.m two.c

得出結果

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章