有些朋友问:foo, bar是什么意思, 为什么C++书籍中老见到这个词。我google了一下, 发现没有很好的中文答案。这个问题,在维基百科上有很好的回答。在这里翻译给大家。

译文:

  术语foobar, foo, bar, bazqux经常在计算机编程或计算机相关的文档中被用作占位符的名字。当变量,函数,或命令本身不太重要的时候,foobar, foo, bar, bazqux就被用来充当这些实体的名字,这样做的目的仅仅是阐述一个概念,说明一个想法。这些术语本身相对于使用的场景来说没有任何意义。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. 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的含义的更多相关文章

  1. 编程中Foo, Bar 到底什么意思?

    1 前言 在很多国外计算机书本和一些第三份开源软件的Demo中经常用到两个英文单词Foo,Bar.这到底是什么意思呢?从步入屌丝界的IT生活见到这两个单词到现在我还是不知道这两个单词的真正含义,今天有 ...

  2. 有趣的冷知识:编程中Foo, Bar 到底什么意思?

    转自:编程中Foo, Bar 到底什么意思? 1 前言 在很多国外计算机书本和一些第三份开源软件的Demo中经常用到两个英文单词Foo,Bar.这到底是什么意思呢?从步入屌丝界的IT生活见到这两个单词 ...

  3. foo,bar,baz

    https://en.wikipedia.org/wiki/Foobar 原文: The terms foobar, foo, bar, baz and qux are sometimes used ...

  4. foo bar的意思

    有些朋友问:foo, bar是什么意思, 为什么C++书籍中老见到这个词. 我google了一下, 发现没有很好的中文答案.这个问题,在维基百科上有很好的回答.在这里翻译给大家. 译文: 术语foob ...

  5. 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

  6. 怎么写makefile?(转)

    跟我一起写 Makefile 陈皓 第一章.概述 什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和 pr ...

  7. 【转】Linux makefile 教程 非常详细,且易懂

    From: http://blog.csdn.net/liang13664759/article/details/1771246 最近在学习Linux下的C编程,买了一本叫<Linux环境下的C ...

  8. javascript基础知识show

    1.javascript的数据类型是什么 基本数据类型:String,boolean,Number,Undefined,Null 引用数据类型:Object(Array,Date,RegExp,Fun ...

  9. linux中Makefile文件相关内容

    第一章.概述什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional(专业)的程序员,m ...

随机推荐

  1. Python 自动化

    一.Win32 GUI自动化测试模块: 1. pywinauto: 下载链接:http://sourceforge.net/projects/pywinauto/ 在线文档:http://pywina ...

  2. visual studio 2019不能在vue文件中直接识别less语法

    试了好多方法,不象vs code那样能直接在template vue文件中就识别less语法下边这种分离的方式是可以的,在项目中也比较实用,将来你代码量大了,样式/脚本也还是要和template代码分 ...

  3. dokcer部署code-server web版vscode

    #dokcer部署code-server web版vscode codercom/code-server:latest不支持插件在线安装 codercom/code-server:v2目前为最新版1. ...

  4. Centos 在线安装 nginx

    centos 在线安装 nginx 安装nginx ​ 参考文档: http://nginx.org/en/linux_packages.html 中的RHEL/CentOS章节,按照步骤安装repo ...

  5. 掌握Pod-Pod调度策略

    一 Pod生命周期管理 1.1 Pod生命周期 Pod在整个生命周期过程中被系统定义了如下各种状态. 状态值 描述 Pending API Server已经创建该Pod,且Pod内还有一个或多个容器的 ...

  6. 正说PropertyValuesProvider的应用

    Github地址:https://github.com/andyslin/spring-ext 编译.运行环境:JDK 8 + Maven 3 + IDEA + Lombok spring-boot: ...

  7. NJCTF (easycrack)

    安装app查看.一个输入框,输入随便输入显示Try again. 放入JEB反编译. 关于输入框监听是第一次见,具体可以看看这个博客https://www.jianshu.com/p/f976c677 ...

  8. 英特尔® 图形性能分析器 2019 R1 版本

    了解并下载全新英特尔® 图形性能分析器 2019 R1 版本.新版本新增了 DX11 和 Vulkan 多帧流捕获模式,可以在“帧和图形跟踪分析器”中分析 Vulkan 应用.此外,帧分析器还添加了 ...

  9. Elasticsearch的选举

    一.bully算法  经过以下几个步骤   1.启动节点ping协调器,获取当前集群状态(节点信息,集群名称等),如果协调器没有启动一直到ping通为止   2.无论能ping通,都会拿到对象acti ...

  10. php导出excel方法: 所有语言通用

    后端: //导出if($_GPC['export']==1){  $list_export = pdo_fetchall($sql.$where);  include $this->templa ...