从另一个文件中使用函数的可能方法是什么,它是由静态初始化的? [英] what is possible way to use the function from the other file, which was initialized by a static?

查看:121
本文介绍了从另一个文件中使用函数的可能方法是什么,它是由静态初始化的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单。

我在我的程序中有三个文件。假设其中一个文件有静态函数。我可以使用另一个函数吗?



我知道文件本身访问的静态函数。我想知道任何可能的方法。



如果方式是可用的,我怎样才能停止函数声明方面的访问?

解决方案

声明为文件范围静态的函数在文件外部是不可见的,这意味着您将无法然后,如果来自同一个文件的函数发出一个指向该函数的指针,代码将能够调用它,因为不涉及解析或查找。


My question is simple.

I have three files in my program.suppose one of files has static function.how can I use that function from the other one?

I knew that static function accessed by the files itself.i want to know any possible way.

If the way is available, how can i stop that access in terms of function declaration?

解决方案

A function declared as file-scope static will not be visible from outside the file, meaning that you will not be able to look the function up by name etc. However, if a function from the same file hands out a pointer to the function, code will be able to call it, since there is no resolving or lookup involved.

这篇关于从另一个文件中使用函数的可能方法是什么,它是由静态初始化的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆