使用静电? [英] Use of static ?
问题描述
你好:
我试图理解在这个程序中使用静态。
http://nanocrew.net/sw/nscdec.c forreverse矩阵。
如果它不是静态的那么会有什么不同,只是const
unsigned char inverse [128]"在它已经是全球空间?
谢谢。
在文章< ; 11 ********************** @ z14g2000cwz.googlegroups .com> ;,
< co ******* @ gmail.com>写道:我试图理解在这个程序中使用静态。
http://nanocrew.net/sw/nscdec.c forreverse矩阵。
如果它不是静态的并且只是const
unsigned char inverse [128],它会有什么不同?在它已经存在的全球空间?
在这个例子中它不在全球空间:使用静态场所
it在文件范围内。如果它是全局的,那么其他例程可能会查看数据或者可能修改数据(const不会 - 估计 -
只读,它只是 - 提示 - 只读。)
-
编程就是在你忙于制定其他计划的时候发生的事情。
Walter Roberson写道:文章< 11 ****************** ****@z14g2000cwz.googlegroups .com> ;,
< co ******* @ gmail.com>写道:我试图理解在这个程序中使用静态。
http://nanocrew.net/sw/nscdec.c forreverse矩阵。如果它不是静态的并且仅仅是const
unsigned char inverse [128],它会有什么不同呢?在它已经存在的全球空间中?
在这个例子中它不在全球空间中:静态的使用将它放在文件范围内。如果它是全局的,那么其他例程可以查看数据或可能修改数据
有意义。我不是在盒子外面思考(在他的代码之外,因为这不是b $ b不是项目的一部分)。谢谢。
(const不是-promise->只读,它只是-hints-只读。)
只有当编译器没有抱怨l值错误。
-
编程是在你忙于制定其他计划时发生的事情。
Walter Roberson写道:文章< 11 ************ **********@z14g2000cwz.googlegroups .com> ;,
< co ******* @ gmail.com>写道:我试图理解在这个程序中使用静态。
http://nanocrew.net/sw/nscdec.c forreverse矩阵。如果它不是静态的并且仅仅是const
unsigned char inverse [128],它会有什么不同呢?在它已经存在的全球空间中?
在这个例子中它不在全球空间中:静态的使用将它放在文件范围内。如果它是全局的,那么其他例程可以查看数据或可能修改数据
是有意义的。我不是在盒子外面思考(在这段
代码之外)因为他们没有涉及项目。谢谢。
(const不是-promise->只读,它只是-hints-只读。)
仅限编译器并没有抱怨l值错误。
-
编程就是在你忙于制定其他计划的时候发生的事情。
>
Hello:
I am trying to understand the use of static in this program.
http://nanocrew.net/sw/nscdec.c for "inverse" matrix.
What difference would it make if it were not static and just "const
unsigned char inverse[ 128 ]" in global space which it already is ?
Thanks.
In article <11**********************@z14g2000cwz.googlegroups .com>,
<co*******@gmail.com> wrote:I am trying to understand the use of static in this program.
http://nanocrew.net/sw/nscdec.c for "inverse" matrix. What difference would it make if it were not static and just "const
unsigned char inverse[ 128 ]" in global space which it already is ?
It isn''t in global space in that example: the use of static places
it in file scope. If it were global then other routines could peek
at the data or possibly modify the data (const doesn''t -promise-
read-only, it only -hints- read-only.)
--
Programming is what happens while you''re busy making other plans.
Walter Roberson wrote:In article <11**********************@z14g2000cwz.googlegroups .com>,
<co*******@gmail.com> wrote:I am trying to understand the use of static in this program.
http://nanocrew.net/sw/nscdec.c for "inverse" matrix.What difference would it make if it were not static and just "const
unsigned char inverse[ 128 ]" in global space which it already is ?
It isn''t in global space in that example: the use of static places
it in file scope. If it were global then other routines could peek
at the data or possibly modify the data
Makes sense. I wasn''t thinking outside the box(outside his code as this
was not part of project). Thanks.
(const doesn''t -promise-> read-only, it only -hints- read-only.)
Only if the compilers didn''t complain about l-value error.
--
Programming is what happens while you''re busy making other plans.
Walter Roberson wrote:In article <11**********************@z14g2000cwz.googlegroups .com>,
<co*******@gmail.com> wrote:I am trying to understand the use of static in this program.
http://nanocrew.net/sw/nscdec.c for "inverse" matrix.What difference would it make if it were not static and just "const
unsigned char inverse[ 128 ]" in global space which it already is ?
It isn''t in global space in that example: the use of static places
it in file scope. If it were global then other routines could peek
at the data or possibly modify the data
makes sense. I wasn''t thinking outside the box(outside this piece of
code) as their was no project involved. Thanks.
(const doesn''t -promise-> read-only, it only -hints- read-only.)
Only if compilers didn''t complain about l-value error.
--
Programming is what happens while you''re busy making other plans.
这篇关于使用静电?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!