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 ...
随机推荐
- SELinux Policy Macros
参考:http://selinuxproject.org/page/NB_RefPolicy Directory Macros macro expansion getattr_dir_perms ge ...
- Python中exec的使用
>>>globals = {'x':7, .....: 'y':10, .....: 'names':['aa','bb','cc'] .....: } >>>lo ...
- javaScript中的一些知识
利用js动态生成table <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http ...
- webstrom官方的活动模版介绍
编辑模板变量对话框 文件|设置|生活模板--编辑变量Windows和LinuxWebStorm |偏好|生活模板--编辑变量在OS XCtrl + Alt + S 当你点击对话框打开 编辑变量按钮模板 ...
- HDU - 5455 Fang Fang
Problem Description Fang Fang says she wants to be remembered.I promise her. We define the sequence ...
- C语言_error_MSB8031
关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法 Visual Studio 2013 编译旧的 mul ...
- laravel 获取最后一条sql的小函数
function lastSql(){ $sql = DB::getQueryLog(); $query = end($sql); return $query; }
- 给table加边框的两种方法
<!DOCTYPE html><html><head><style>.a { border-spacing: 1px; background-color ...
- Linux文件系统中硬链接和软链接的区别 (转)
建立硬链接命令:ln src-link dest-link建立软链接:ln -s src-link dest-link 1. 硬链接是别名,软链接是快捷方式 2. 硬链接和源链接指向同一个i节 ...
- perl的package和module
来源: http://www.cnblogs.com/itech/archive/2010/03/23/1692836.html 一 package 1) package 相当于C++中的namesp ...