Oc-03-oc access to the OC source file, C source file functions

Source: Internet
Author: User

Show.h

#ifndef __ocday01__show__#define __ocday01__show__#include <stdio.h>extern void Testtshow (); #endif/* Defined (_ _OCDAY01__SHOW__) */

Show.c

#include "Show.h" void Testtshow () {    printf ("I am a function in the famous C file, who dares to invoke?  "). haha  \ n ");}

MAIN.M (OC source file)

  6-"Understanding" access to OC source files, functions in C source files #import <foundation/foundation.h>//Introduce the header file of Show #import "Show.h" void  test1 () {    printf ("Hello I am the  C language function  I put in the  OC original file, do you dare to call me all at once  ?  " Ha ha  \ n ");} int main (int argc, const char * argv[]) {    @autoreleasepool {        //oc)   is feasible to access the C language function written in the OC source file.         Test1 ();  It is possible to access the C function written in the C file in OC.        Testtshow ();    }    return 0;}

Oc-03-oc access to the OC source file, C source file functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.