foo bar的意思
有些朋友问:foo, bar是什么意思, 为什么C++书籍中老见到这个词。
我google了一下, 发现没有很好的中文答案。这个问题,在维基百科上有很好的回答。在这里翻译给大家。
译文:
术语foobar, foo, bar, baz 和qux经常在计算机编程或计算机相关的文档中被用作占位符的名字。当变量,函数,或命令本身不太重要的时候,foobar, foo,bar, baz 和qux就被用来充当这些实体的名字,这样做的目的仅仅是阐述一个概念,说明一个想法。这些术语本身相对于使用的场景来说没有任何意义。Foobar经常被单独使用;而当需要多个实体举例的时候,foo,bar,和baz则经常被按顺序使用。
原文:
The terms foobar, foo, bar, baz and qux are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation.[1] They have been used to name entities such as variables, functions, and commands whose purpose is unimportant and serve only to demonstrate a concept. The words themselves have no meaning in this usage. Foobar is sometimes used alone; foo, bar, and baz are sometimes used in that order, when multiple entities are needed.
// C code example
#include <stdio.h> int foobar(int *pi)
{
*pi = 1024;
return *pi;
} int main()
{
char foo[] = "Hello,";
char bar[] = "World!";
printf("%s %s\n", foo, bar); int baz = foobar();
printf("%d, baz");
return 0;
}
foo bar的意思的更多相关文章
- 编程中Foo, Bar 到底什么意思?
1 前言 在很多国外计算机书本和一些第三份开源软件的Demo中经常用到两个英文单词Foo,Bar.这到底是什么意思呢?从步入屌丝界的IT生活见到这两个单词到现在我还是不知道这两个单词的真正含义,今天有 ...
- foo,bar,baz
https://en.wikipedia.org/wiki/Foobar 原文: The terms foobar, foo, bar, baz and qux are sometimes used ...
- 有趣的冷知识:编程中Foo, Bar 到底什么意思?
转自:编程中Foo, Bar 到底什么意思? 1 前言 在很多国外计算机书本和一些第三份开源软件的Demo中经常用到两个英文单词Foo,Bar.这到底是什么意思呢?从步入屌丝界的IT生活见到这两个单词 ...
- Foo, Bar的含义
有些朋友问:foo, bar是什么意思, 为什么C++书籍中老见到这个词.我google了一下, 发现没有很好的中文答案.这个问题,在维基百科上有很好的回答.在这里翻译给大家. 译文: 术语fooba ...
- WARNING: The following packages cannot be authenticated! foo bar baz Install these packages without verification [y/N]?
apt-get install debian-archive-keyring apt-get update
- linux 将foo制定n, m之间行的内容, 追加到bar文件
sed -ne '196, 207 p' foo >> bar;把文件foo 196-行207行的内容追加到 bar文件
- foo是什么?
在英文程序员社区里,foo bar baz这些词是常用于作为占位符而使用的.要查wiki的话,这项更合适:http://en.wikipedia.org/wiki/Metasyntactic_vari ...
- 伪变量foo foober是什么意思
原文: The terms foobar, foo, bar, baz and qux are sometimes used as placeholder names (also referred t ...
- 【转】elasticsearch中字段类型默认显示{ "foo": { "type": "text", "fields": { "keyword": {"type": "keyword", "ignore_above": 256} }
官方原文链接:https://www.elastic.co/cn/blog/strings-are-dead-long-live-strings 转载原文连接:https://segmentfault ...
随机推荐
- 怎么查看window7的.net framework的版本
第一步.打开控制面板,在大图标查看方式下,点击“程序和功能” 第二步.在程序和功能界面,点击左侧“打开或关闭Windows功能” 第三步.在打开或关闭Windows功能界面,通过拖动滚动条的方式,找到 ...
- C#中AES加密和解密
/// AES加密 /// </summary> /// <param name="inputdata">输入的数据</param> /// & ...
- C: strcpy & memcpy & scanf/printf format specifier.. escape characters..
well, strcpy differs from memcpy in that it stops copy at \0 the format specifier is a string.. whic ...
- 1-10w之间的整数中有几个完全平方数
#include "stdio.h" #include<math.h> void main() { ,x,y; printf("1-10w之间的整数中有以下几 ...
- 利用socket模块检查端口存活并邮件警报
可以用来监控一些端口. import socket def check_server(addr, port): s = socket.socket() try: s.connect((addr, po ...
- wmts调用路径手工合成
wmts调用路径手工合成 一般OGC WMTS地图只提供了xml描述,地图应用常常要合成WMTS完整的调用URL.我们需要获知以下参数: BaseURL:例如 "http://10.36.5 ...
- 在Java中Arrays工具类实现功能的六种方法
使用Arrays工具类,要先导入包即:import.java.util.Arrays 以下是实现六种功能的方法: 1.比较两个数组值是否相等: 结果为true.false.(布尔型不能比较) int ...
- YII2 小部件(widgets)
小部件基本上在views中使用,在视图中可调用 yii\base\Widget::widget() 方法使用小部件. 该方法使用 配置 数组初始化小部件并返回小部件渲染后的结果. 例如如下代码插入一个 ...
- JS总结之二:DOM对象控制HTML
DOM对象控制HTML 1.方法 getElementsByName( ) ——获取name getElementsByTagName( ) ——获取元素 getAttribute( ) ——获取元素 ...
- 全选js实现
前端全选框 <input type='checkbox' name='allSelect' onclick='sel(this)'></input> //有i个选择框 < ...