查看“︁Foobar”︁的源代码
←
Foobar
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{TA|G1=IT}} {{otheruses}} '''foobar'''是電腦程式領域裏的术语,並無實際用途和參考意義。在[[计算机程序设计]]与计算机技术的相关文档中,术语'''foobar'''是一个常见的[[无名氏]]化名,常被作为“{{le|伪变量|metasyntactic variable}}”使用。 ==歷史== 从技术上讲,“foobar”很可能在1960年代至1970年代初通过[[迪吉多]]的系统手册传播开来。另一种说法是,“foobar”可能来源于电子学中反转的foo信号(<math>\bar{q}</math>);这是因为如果一个数字信号是低电平有效(即负压或零电压代表“1”),那么在信号标记上方一般会标有一根水平横线,而横线的英文即为“bar”。在《[[新黑客辞典]]》中,还提到“foo”可能早于“[[FUBAR]]”出现。<ref>[http://www.catb.org/jargon/html/F/foobar.html 《新黑客辞典》] {{Wayback|url=http://www.catb.org/jargon/html/F/foobar.html |date=20081212195734 }}(The Jargon File)</ref> 在大约1930年至1952年之间,foo出现在{{le|比尔·霍尔曼|Bill Holman (cartoonist)}}的漫画《{{le|Smokey Stover}}》中,比尔·霍尔曼说他之所以使用这个词,是因为在旧金山唐人街的一个中国玉雕雕像的底部看到了这个词,据称它象征着“好运”。<ref>{{Cite web|url=https://www.smokey-stover.com/history.html|title=The History of Bill Holman|date=2007-06-13|publisher=[[Smokey Stover]]|accessdate=2019-08-17|archive-date=2019-08-30|archive-url=https://web.archive.org/web/20190830202223/http://www.smokey-stover.com/history.html|dead-url=no}}</ref>这可能与汉字“福”有关,“福”有时被翻译为“'foo”。<ref name="dictionary">{{Cite web|url=https://www.dictionary.com/e/foo/|title=What does foo mean?|publisher=[[Dictionary.com]]|accessdate=2019-08-17|archive-date=2019-08-17|archive-url=https://web.archive.org/web/20190817211802/https://www.dictionary.com/e/foo/|dead-url=no}}</ref> ==例子== 单词“foobar”或分离的“foo”与“bar”常出现于程序设计的案例中,如同[[Hello World]]程序一样,它们常被用于向学习者介绍某种程序语言。 “foo”“bar”常被作为函数/方法的名称或变量名。 下面是一段通过“foo”和“bar”来演示如何在[[Java]]、[[C語言|C]]及[[C++]]中连接两个字符串的实例程序: <syntaxhighlight lang="Java"> //Java code String foo = "Hello, "; String bar = "World"; System.out.println(foo + bar); //Hello, World is printed to the screen by printing foo and bar </syntaxhighlight> <syntaxhighlight lang="c"> // C code #include <stdio.h> int main() { char foo[] = "Hello,"; char bar[] = "World!"; printf("%s %s\n", foo, bar); return 0; } </syntaxhighlight> <syntaxhighlight lang="cpp"> // C++ code #include <iostream> #include <string> using namespace std; int main() { string foo = "Hello,"; string bar = "World!"; cout << foo << " " << bar << endl; return 0; } </syntaxhighlight> <syntaxhighlight lang="python"> # Python code foo = "Hello," bar = "World!" print(foo + bar) </syntaxhighlight> ==參見== *[[无名氏]] *[[FUBAR (電視劇)]] *[[foobar2000]] ==參考文獻== {{reflist}} ==外部連接== {{wiktionarypar|foobar}} *[http://www.catb.org/~esr/jargon/html/F/foobar.html The Jargon File entry on foobar]{{Wayback|url=http://www.catb.org/~esr/jargon/html/F/foobar.html |date=20081015133933 }} *RFC 3092 - Origin and usage of ''foobar'' *[https://web.archive.org/web/20160324/http://www.maximumpc.com/how-to-manage-your-music-the-power-user-way-with-foobar/ Foobar2000 is an advanced audio player for the Windows platform] *RFC 1639 - FTP Operation Over Big Address Records (FOOBAR) [[Category:化名]] [[Category:变量]]
该页面使用的模板:
Template:Cite web
(
查看源代码
)
Template:Le
(
查看源代码
)
Template:Otheruses
(
查看源代码
)
Template:Reflist
(
查看源代码
)
Template:TA
(
查看源代码
)
Template:Wayback
(
查看源代码
)
Template:Wiktionarypar
(
查看源代码
)
返回
Foobar
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息