some sentenses from The c++ programming language chapter9

原创 2006年06月18日 16:06:00

Where the unit of compilation is a file, all of a file must be recompiled
whenever a change (however small) has been made to it or to something on which it depends.

The keyword extern indicates
that the declaration of x in file2.c is (just) a declaration and not a definition (§4.9). Had x
been initialized, extern would simply be ignored because a declaration with an initializer is always
a definition.

Note that a
variable defined without an initializer in the global or a namespace scope is initialized by default.
This is not the case for local variables (§4.9.5, §10.4.2) or objects created on the free store

An inline function (§7.1.1, §10.2.9) must be defined – by identical definitions (§9.2.3) – in
every translation unit in which it is used.

By default, consts (§5.4) and typedefs (§4.9.7) have internal linkage.
A const can be given external linkage by an explicit declaration.

An unnamed namespace (§8.2.5) can be used to make names local to a compilation unit.

#include <iostream> / / from standard include directory
#include "myheader.h" / / from current directory
Unfortunately, spaces are significant within the< > or" " of an include directive:
#include < iostream > / / will not find <iostream>

A given class, enumeration, and template, etc., must be defined exactly once in a program.
#ifndef CALC_  ERROR_  H
#define CALC_  ERROR_  H
namespace Error {
/ / ...
#endif / / CALC_ERROR_H

a variable defined outside any function (that is, global, namespace, and class static
variables) is initialized before main() is invoked.

There is no guaranteed order of initialization of global variables in different translation units.

it is not possible to catch an exception thrown by the initializer
of a global variable

Often, a function returning a reference is a good alternative to a global variable.

《The C Programming Language》读书笔记总结 <一>.基础篇

写了这么多年的C代码,回过头来再看《The C Programming Language》这本书,作者Brian W. Kernighan和C语言之父Dennis M. Ritchie。感觉里面的知识...
  • Eastmount
  • Eastmount
  • 2015年10月21日 16:14
  • 2086

读经典《C程序设计语言》(The C Programming Language)

  • stc_XC
  • stc_XC
  • 2017年05月30日 22:54
  • 754

摘抄“GPU Programming And Cg Language Primer 1rd Edition” 中文名“GPU编程与CG语言之阳春白雪下里巴人”

  • xuexiaokkk
  • xuexiaokkk
  • 2015年11月18日 16:18
  • 337

撰写related work 格式方面心得

  • fht1051066200
  • fht1051066200
  • 2014年07月29日 02:13
  • 4524

programming language 第一周作业答案

fun is_older (x : int*int*int, y : int*int*int) = if #1 x 1 y then #1 x 1 y else ...
  • winter_wu_1998
  • winter_wu_1998
  • 2018年01月10日 11:01
  • 30

《The C Programming Language》读书笔记总结 <一>.基础篇

写了这么多年的C代码,回过头来再看《The C Programming Language》这本书,作者Brian W. Kernighan和C语言之父Dennis M. Ritchie。感觉里面的...
  • paul123456789io
  • paul123456789io
  • 2017年02月09日 11:44
  • 387


C++编译不通过问题排查 1.   其中的C++ Language Dialect 是否设置为 Compiler Default C++ Standard Library    是否设置为Co...
  • diyagoanyhacker
  • diyagoanyhacker
  • 2013年01月25日 20:46
  • 1942


查看docker网络接口信息命令ifconfig(命令输出详解在之前的博文中介绍过) [root@VM_116_112_centos ~]# ifconfig docker0: flags=416...
  • u013246898
  • u013246898
  • 2016年11月11日 15:23
  • 7358

The Swift Programming Language学习笔记(十二)——方法

方法 实例方法 方法的局部参数名称和外部参数名称 修改方法的外部参数名称 self属性 在实例方法中修改值类型 在可变方法中给self赋值 类型方法 方法方法是与某些特定类型相关联的函数。类、结构体、...
  • a1546488968
  • a1546488968
  • 2016年02月23日 20:04
  • 172

The C Programming Language 第四章函数与程序结构 读书笔记

  • wtrnash
  • wtrnash
  • 2015年08月03日 21:15
  • 717
您举报文章:some sentenses from The c++ programming language chapter9