C语言day05-13inculde指令

作者: liyuhong165 | 来源:发表于2016-04-30 11:53 被阅读70次

    pragma mark inculde指令

    pragma mark 概念

    pragma mark 代码

    #include <stdio.h>  // 告诉系统printf函数是存在的,告诉系统printf的函数(声明printf函数)
    
    //#include的作用,是讲include右边的文件拷贝到当前文件中
    int main()
    {
        //    inculde指令不一定写在文件的头部
        printf("say hello\n");
    #include "/Users/liyuhong165/Desktop/IOS教程项目/2016_Study_iOS/XMG代码/5.第五天/day05/include指令/abc/lyh.txt"
        return 0;
    }
    /*
     include 后面的<> 和 "" 的区别
     > 如果使用<>代表会先从开发工具的编译环境中去查找
     > 如果编译环境中没有找到,那么会再去系统的编译环境中找
     
     > 如果使用""代表会先从当前文件所在的文件夹下面去查找           (include指令文件夹)
     > 如果在当前文件所在的文件夹下面没有找到,那么就回去开发工具的编译环境中去查找 (abc文件夹) #include "abc/lyh.txt"(相对路径)
    
     > 如果编译环境中没有找到,那么会再去系统的编译环境中找
     
     注意·include后面不一定写文件名称 也可以写路径(相对路径/全路径)
    // #include "abc/lyh.txt"(相对路径)
    // #include "/Users/liyuhong165/Desktop/IOS教程项目/2016_Study_iOS/XMG代码/5.第五天/day05/include指令/abc/lyh.txt" (全路径)
    // 系统的编译环境 路径 
     --Xcode 显示包内容 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdio.h
     
     // 显示电脑的隐藏文件夹
     显示Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool true
     隐藏Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool false
     或者
     显示Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles  YES
     隐藏Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles  NO
     
     // 安装comLine
     查看有没有安装comline 需要到 /usr 下面查看有没有include的文件夹
     如果没有
     直接使用终端 xcode-select --install
     */
    
    

    相关文章

      网友评论

        本文标题:C语言day05-13inculde指令

        本文链接:https://www.haomeiwen.com/subject/stskrttx.html