C/C++程序员查询辞典:第二版

C/C++程序员查询辞典:第二版
作 者: Herbert Schildt 陈君 陈君
出版社: 中国铁道出版社
丛编项: 查询辞典丛书
版权说明: 本书为公共版权或经版权方授权,请支持正版图书
标 签: 暂缺
ISBN 出版时间 包装 开本 页数 字数
未知 暂无 暂无 未知 0 暂无

作者简介

  HerbertSchildt是C和C++领域的权威,并且是负责C和C++标准化的ANSI/ISO协会的成员。他的书在全球范围内已经售出了250万本。并且翻译成所有主要的语种。他撰写了C:TheCompleteReference、C++:TheCompleteReference、C++fromtheGroundUp以及许多其他的畅销书,包括Windows2000ProgrammingfromtheGroundUp和MFCProgrammingfromtheGroundUp。他还与人合作编写了Java2:TheCompleteReference一书。

内容简介

C和C++是世界上最重要的编程语言。在当今的世界中,要成为专业的程序员,就意味着必须熟悉这两种语言。它们是现代编程的基础。C语言是在20世纪70年代由DennisRitchie发明的。它是一种中级语言。C语言将高级语言的控制结构、位操作能力以及指针(地址)结合起来。这样,程序员就几乎可以使用C语言完全控制机器。C语言是在1980年末第一次标准化的,当时采用了C语言的ANSI(美国国家标准化协会,AmericanNationalStandardsInstitute)标准。这一版本的C语言通常称为C89。这一标准还由ISO(国际标准化组织,InternationalStandardsOrganizaion)所采用。1995年,C89又做了细微的修订。C++是在1979年由BjarneStroustriup发明的。在20世纪80年代以及90年代的大部分时间里,许多人为C++的发展和修订做出了不懈的努力。最后,在1998年,采用了C++的一个ANSl/lSO标准。简单地说,C++就是C语言的面向对象版本。C++是在C89及其1995年修订的基础上构建起来的。实际上,C89所定义的C语言版本通常被称为“C++的C子集”。虽然C++是从对C语言的一组面向对象扩展开始的,但很快它就发展成为一种独立的编程语言。今天,C++的大小几乎是C语言的两倍。毋庸赘述,C++是人类所设计出来的最强大的计算机语言之一。在1999年,采用了C语言的一个新的ANSI/ISO标准。这个版本称为C99。它包括了许多改进以及几种新功能。其中一些“新”功能是从C++借鉴的,而另外一些则是全新的创新,因此,C99所添加的某些功能与C++不兼容。这表示随着C99的出现,标准C语言不再是C++的纯子集。所幸的是,许多不兼容性是与很容易避免的专用功能相关的。因此,仍然能够很方便地编写与C和C++都兼容的代码。在编写本书时,还没有一种主要的编译器接受了所有的C99添加功能,但这种状况肯定是要改变的。下表简单地介绍了C89、C99和C++之间的关系。C89C语言最初的ANSI/ISO标准。C89就是现在大部分程序员认作C语言的版本。C++C语言的面向对象版本。C++的当前ANSl/lSO标准是在C89的基础上建立起来的,因此,C89形成了C++的子集。C99C语言的最新版本。包括C89的所有功能,并且添加了几种新功能。C++的当前标准不支持其中的一些新功能。...

图书目录

Chapter 1 数据类型、变量和常量 1

基本类型 1

声明变量 3

初始化变量 3

标识符 4

类 4

继承 6

结构 7

联合 7

枚举 9

C标记 9

类存储限定符 10

extern 10

auto 10

register 10

static 11

mutable 11

类型限定符 11

const 11

volatile 12

restrict 12

数组 12

使用typedef定义新的类型名 13

常量 13

十六进制和八进制常量 14

字符串常量 14

布尔常量 14

复数常量 15

反斜线字符常量 15

Chapter 2 函数、范围、命名空间和头文件 17

函数 17

递归 18

函数重载 19

默认参数 19

原型 20

理解范围和变量生命周期 21

命名空间 22

main()函数 23

函数参数 23

传递指针 24

引用参数 25

构造函数和析构函数 26

函数限定符 26

连接限定符 27

C和C++标准库 27

Chapter 3 运算符 31

算术运算运算符 31

关系和逻辑运算运算符 32

位逻辑运算运算符 33

&、|和^ 33

反码运算运算符 34

移位运算运算符 34

指针运算符 35

&指针运算符 35

*指针对象 36

赋值运算符 36

?运算符 37

成员运算符 37

逗号运算符 38

sizeof 38

强制类型转换运算符 38

C++强制类型转换 39

I/O运算符 39

.*和->*成员指针运算符 40

::范围解析运算符 41

new和delete 41

typeid 41

运算符重载 42

运算符优先级总结 42

Chapter 4 预处理程序和注释 45

#define 45

#error 46

#if、#ifdef、#ifndef、#else、#elif和#endif 46

#include 48

#line 48

#pragma 49

C99的_Pragma运算符 49

C99内置编译选项 49

#undef 49

#和##预处理程序运算符 50

预定义宏名称 51

C99定义的其他内置宏 51

注释 52

C99变量参数列表 52

Chapter 5 关键字总结 53

asm 53

auto 54

bool 54

_Bool 54

break 54

case 55

catch 55

char 55

class 55

_Complex 56

const 56

const_cast 56

continue 57

default 57

delete 57

do 57

double 58

dynamic_cast 58

else 58

enum 58

explicit 59

export 59

extern 59

false 60

float 60

for 60

friend 60

goto 61

if 62

_Imaginary 63

inline 63

int 63

long 64

mutable 64

namespace 64

new 65

operator 66

private 66

protected 67

public 68

register 68

reinterpret_cast 69

restrict 69

return 70

short 70

signed 70

sizeof 70

static 71

static_cast 71

struct 71

switch 72

template 73

this 76

throw 76

true 78

try 79

typedef 79

typeid 79

typename 79

union 79

unsigned 80

using 80

virtual 80

void 81

volatile 81

wchar_t 81

while 81

Chapter 6 标准C I/O函数 83

clearerr 84

fclose 84

feof 84

ferror 85

fflush 85

fgetc 85

fgetpos 86

fgets 86

fopen 86

fprintf 88

fputc 89

fputs 89

fread 89

freopen 90

fscanf 90

fseek 91

fsetpos 91

ftell 91

fwrite 92

getc 92

getchar 93

gets 93

perror 94

printf 94

C99为printf()增加的格式修饰符 97

putc 97

putchar 98

puts 98

remove 98

rename 98

rewind 99

scanf 99

C99为scanf()增加的格式修饰符 102

setbuf 102

setvbuf 103

snprintf 103

sprintf 103

sscanf 104

tmpfile 104

tmpnam 104

ungetc 105

vprintf、vfprintf、vsprintf和vsnprintf 105

vscanf、vfscanf和vsscanf 106

Chapter 7 字符串和字符函数 107

isalnum 107

isalpha 108

isblank 108

iscntrl 108

isdigit 108

isgraph 109

islower 109

isprint 109

ispunct 109

isspace 110

isupper 110

isxdigit 110

memchr 110

memcmp 111

memcpy 111

memmove 111

memset 112

strcat 112

strchr 112

strcmp 113

strcoll 113

strcpy 113

strcspn 114

strerror 114

strlen 114

strncat 114

strncmp 115

strncpy 115

strpbrk 116

strrchr 116

strspn 116

strstr 116

strtok 117

strxfrm 117

tolower 118

toupper 118

Chapter 8 C数学函数 119

acos 121

acosh 121

asin 121

asinh 122

atan 122

atanh 122

atan2 123

cbrt 123

ceil 123

copysign 123

cos 124

cosh 124

erf 124

erfc 125

exp 125

exp2 125

expm1 125

fabs 126

fdim 126

floor 126

fma 127

fmax 127

fmin 127

fmod 127

frexp 128

hypot 128

ilogb 128

ldexp 129

lgamma 129

llrint 129

llround 130

log 130

log1p 130

log10 131

log2 131

logb 131

lrintf 132

lround 132

modf 132

nan 132

nearbyint 133

nextafter 133

nexttoward 133

pow 134

remainder 134

remquo 134

rint 135

round 135

scalbn 135

scalbln 136

sin 136

sinh 136

sqrt 137

tan 137

tanh 137

tgamma 137

trunc 138

Chapter 9 C++数学函数 139

acos 139

asin 140

atan 140

atan2 140

ceil 140

cos 141

cosh 141

exp 141

fabs 141

floor 142

fmod 142

frexp 142

ldexp 142

log 143

log10 143

modf 143

pow 144

sin 144

sinh 144

sqrt 145

tan 145

tanh 145

Chapter 10 时间、日期和本地化函数 147

asctime 147

clock 148

ctime 148

difftime 148

gmtime 149

localeconv 149

localtime 151

mktime 151

setlocale 153

strftime 153

time 155

Chapter 11 动态分配函数 157

calloc 157

free 158

malloc 158

realloc 158

Chapter 12 杂类函数 161

abort 161

abs 162

assert 162

atexit 162

atof 162

atoi 163

atoll 163

bsearch 163

div 164

exit 164

_Exit 165

getenv 165

labs 165

ldiv 165

llabs 166

lldiv 166

longjmp 166

mblen 167

mbstowcs 167

mbtowc 167

qsort 168

raise 169

rand 169

setjmp 170

signal 170

srand 170

strtod 171

strtof 171

strtol 172

strtold 172

strtoll 172

strtoul 173

strtoull 173

system 174

va_arg、va_start、va_end和va_copy 174

wcstombs 176

wctomb 176

Chapter 13 宽字符函数 177

宽字符分类函数 177

宽字符I/O函数 179

宽字符串函数 180

宽字符串转换函数 182

宽字符数组函数 183

多字节/宽字符转换函数 184

Chapter 14 传统风格的C++ I/O系统 187

基本的流类 188

C++的预定义流 188

格式标记 189

I/O操作函数 190

传统风格的iostream函数 190

bad 190

clear 191

eatwhite 191

eof 191

fail 191

fill 192

flags 192

flush 192

fstream、ifstream和ofstream 193

gcount 194

get 194

getline 195

good 195

ignore 195

open 196

peek 198

precision 198

put 199

putback 199

rdstate 199

read 200

seekg和seekp 200

setf 201

setmode 202

str 202

strstream、istrstream和ostrstream 202

sync_with_stdio 203

tellg和tellp 203

unsetf 204

width 204

write 204

Chapter 15 ANSI/ISO标准C++ I/O类 207

使用标准C++ iostream库 207

标准C++ I/O类 207

C++的预定义流 209

I/O头 210

格式标记 210

I/O操作函数 211

几个数据类型 214

streamsize和streamoff类型 214

streampos和wstreampos类型 214

pos_type和off_type类型 214

openmode类型 214

iostate类型 215

seekdir类型 215

failure类 215

重载的<<和>>运算符 215

ANSI/ISO标准I/O函数 216

bad 216

clear 216

eof 216

exceptions 217

fail 217

fill 217

flags 217

flush 218

fstream、ifstream和ofstream 218

gcount 219

get 219

getline 220

good 221

ignore 221

open 221

peek 222

precision 222

put 224

putback 224

rdstate 225

read 225

readsome 225

seekg和seekp 226

setf 226

setstate 227

str 227

stringstream、istringstream和ostringstream 228

sync_with_stdio 228

tellg和tellp 229

unsetf 229

width 229

write 230

Chapter 16 C++ 标准模板库 231

STL概述 231

容器 231

算法 231

迭代器 232

其他的STL元素 232

容器类 235

bitset 236

deque 238

list 240

map 243

multimap 245

multiset 246

queue 248

priority_queue 249

set 250

stack 252

vector 252

STL算法 255

adjacent_find 255

binary_search 256

copy 256

copy_backward 256

count 256

count_if 256

equal 257

equal_range 257

fill和fill_n 257

find 258

find_end 258

find_first_of 258

find_if 259

for_each 259

generate和generate_n 259

includes 259

inplace_merge 260

iter_swap 260

lexicographical_compare 260

lower_bound 261

make_heap 261

max 261

max_element 261

merge 262

min 262

min_element 262

mismatch 263

next_permutation 263

nth_element 263

partial_sort 264

partial_sort_copy 264

partition 264

pop_heap 264

prev_permutation 265

push_heap 265

random_shuffle 265

remove、remove_if、remove_copy和 remove_copy_if 266

replace、replace_copy、replace_if和replace_copy_if 266

reverse和reverse_copy 267

rotate和rotate_copy 267

search 268

search_n 268

set_difference 269

set_intersection 269

set_symmetric_difference 269

set_union 270

sort 270

sort_heap 270

stable_partition 271

stable_sort 271

swap 271

swap_ranges 271

transform 272

unique和unique_copy 273

upper_bound 274

Chapter 17 C++ 字符串、异常和复数类 275

字符串 275

异常 286

286

288

复数类 288

Chapter 18 C99增加的库功能 293

复数库 293

浮点环境库 296

头文件 298

整数格式转换函数 298

通用类型数学宏 299

头文件