GithubHelp home page GithubHelp logo

c-demo's Introduction

c examples

build

make all

The Course

tips

about static

/**
In C, functions are global by default. 

Unlike global functions in C, access to static functions is restricted to the 
file where they are declared. Therefore, when we want to restrict access to 
functions, we make them static. Another reason for making functions static can 
be reuse of the same function name in other files.

*/
static void f(); // 这里的 static 说明此 f 函数只在当前文件可见

// only visible to this file
static int a = 5; // 这里的 static 说明 a 的值,只初始化 1次, 之后的每次调用都在当前值的基础上变化,即使它被定义在函数的内部
// 这里 Q 这个变量是静态的,只能在声明所在的文件被访问,且它的值是会记忆的在每次函数调用间, 所以消息队列这种概念,就很适合声明为 static 的
static struct global_quene * Q=null

funciton pointer

/**
pointer referred to a function
sutiable to be used as a param of a function to implement interface like things
*/

// 这里 func 是指向函数的指针, 要求被引用的函数返回值是 void, 参数为空
void (*func)();

int (*func)(int, int);

void* (*func)(void*, void*);

const

....

inline function

....

c-demo's People

Contributors

xm-tech avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.