Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

lafore_robert_objectoriented_programming_in_c

.pdf
Скачиваний:
51
Добавлен:
27.03.2023
Размер:
8.94 Mб
Скачать

ASCII Chart

855

TABLE A.1 Continued

DEC

HEX

Symbol

Key

Use in C

160

A0

á

Alt 160

161

A1

í

Alt 161

162

A2

ó

Alt 162

163

A3

ú

Alt 163

164

A4

ñ

Alt 164

165

A5

Ñ

Alt 165

166

A6

a

Alt 166

167

A7

o

Alt 167

168

A8

®

Alt 168

169

A9

©

Alt 169

170

AA

Alt 170

171

AB

´

Alt 171

172

AC

¨

Alt 172

173

AD

¡

Alt 173

174

AE

«

Alt 174

175

AF

»

Alt 175

176

B0

¤

Alt 176

177

B1

¤

Alt 177

178

B2

¤

Alt 178

179

B3

Alt 179

180

B4

¥

Alt 180

181

B5

µ

Alt 181

182

B6

Alt 182

183

B7

Alt 183

184

B8

Alt 184

185

B9

π

Alt 185

186

BA

Alt 186

187

BB

ª

Alt 187

188

BC

º

Alt 188

189

BD

Alt 189

190

BE

æ

Alt 190

191

BF

Alt 191

A

C ASCII

HART

856

Appendix A

 

TABLE A.1 Continued

DEC

HEX

Symbol

Key

Use in C

192

C0

¿

Alt 192

 

193

C1

¡

Alt 193

 

194

C2

¬

Alt 194

 

195

C3

Alt 195

 

196

C4

ƒ

Alt 196

 

197

C5

Alt 197

 

198

C6

Alt 198

 

199

C7

«

Alt 199

 

200

C8

»

Alt 200

 

201

C9

Alt 201

 

202

CA

g

Alt 202

 

203

CB

À

Alt 203

 

204

CC

Ã

Alt 204

 

205

CD

Õ

Alt 205

 

206

CE

Œ

Alt 206

 

207

CF

œ

Alt 207

 

208

D0

Alt 208

 

209

D1

Alt 209

 

210

D2

Alt 210

 

211

D3

Alt 211

 

212

D4

¿

Alt 212

 

213

D5

Alt 213

 

214

D6

÷

Alt 214

 

215

D7

Alt 215

 

216

D8

ÿ

Alt 216

 

217

D9

Ÿ

Alt 217

 

218

DA

Alt 218

 

219

DB

¤

Alt 219

 

220

DC

Alt 220

 

221

DD

Alt 221

 

222

DE

Alt 222

 

223

DF

Alt 223

 

ASCII Chart

857

 

TABLE A.1 Continued

DEC

HEX

Symbol

Key

Use in C

224

E0

α

Alt 224

 

 

225

E1

β

Alt 225

 

 

226

E2

Γ

Alt 226

 

 

227

E3

π

Alt 227

 

 

228

E4

Σ

Alt 228

 

 

229

E5

Â

Alt 229

 

A

230

E6

µ

Alt 230

 

 

231

E7

τˇ

Alt 231

 

 

232

E8

Ë

Alt 232

 

 

233

E9

Θ

Alt 233

 

 

234

EA

Alt 234

 

 

235

EB

Î

Alt 235

 

 

236

EC

Ï

Alt 236

 

 

237

ED

ϕ

Alt 237

 

 

238

EE

 

Alt 238

 

 

239

EF

Ô

Alt 239

 

 

240

F0

Alt 240

 

 

241

F1

±

Alt 241

 

 

242

F2

Alt 242

 

 

243

F3

Alt 243

 

 

244

F4

Ù

Alt 244

 

 

245

F5

ı

Alt 245

 

 

246

F6

÷

Alt 246

 

 

247

F7

˜

Alt 247

 

 

248

F8

°

Alt 248

 

 

249

F9

Alt 249

 

 

250

FA

.

Alt 250

 

 

251

FB

 

Alt 251

 

 

252

FC

η

Alt 252

 

 

253

FD

2

Alt 253

 

 

254

FE

Alt 254

 

 

255

FF

(blank)

Alt 255

 

 

 

 

 

 

 

 

ASCIIC HART

Appendix A

858

Those key sequences consisting of “Ctrl” are typed by pressing the Ctrl key, and while it is being held down, pressing the key indicated. These sequences are based on those defined for PC Personal Computer series keyboards. The key sequences may be defined differently on other keyboards.

IBM Extended ASCII characters can be displayed by pressing the Alt key and then typing the decimal code of the character on the keypad.

C++ Precedence Table

A PPENDI X

and Keywords

B

 

Appendix B

860

Precedence Table

This precedence table is a more complete version of the one shown in Chapter 3. It includes the bitwise operators, which, although they are not described as such in this book, can be overloaded, as << and >> are for stream input and output.

Operator type

Operators

Scope

::

Various

[], (), . (dot), ->, postfix ++ and --

Unary

prefix ++ and --, &, *, +, -, !

Arithmetic

Multiplicative *, /, %

 

Additive +, -

Bitwise shifts

<<, >>

Relational

Inequality <, >, <=, >=

 

Equality ==, !=

Bitwise logic

&, ^, |

Logical

&&, ||

Conditional

?:

Assignment

=, *=, /=, %=, +=, -=

 

<<=, >>=, &=, ^=, |=

Sequence

, (comma)

Keywords

Keywords implement specific C++ language features. They cannot be used as names for variables or other user-defined program elements. Many of the keywords are common to both C and C++, while others are specific to C++. Some compilers may support additional keywords, which usually begin with one or two underscores, as in _cdecl or __int16.

asm auto

bool break

case catch char class const

const_cast continue

default delete do double

dynamic_cast

else enum explicit export extern

false float for friend

goto

if inline int

long

main mutable

namespace new

operator

private protected public

register reinterpret_cast return

short signed sizeof static static_cast struct switch

template this

C++ Precedence Table and Keywords

861

B

EYWORDSK

ANDABLET

RECEDENCEPC++

Appendix B

862

throw true try typedef typeid

typename

union unsigned using

virtual void volatile

wchar_t while

Microsoft Visual C++

A PPENDI X

C

IN THIS APPENDIX

Screen Elements 864

Single-File Programs

864

Multifile Programs

866

Building Console Graphics Lite Programs 868

• Debugging 868

Appendix C

864

This appendix tells you how to use Microsoft Visual C++ (MVC++) to create console-mode applications, which are the kind of applications used in this book. This discussion is based on MVC++ version 6.0.

The present version of MVC++ has good (although not perfect) adherence to Standard C++. It comes in various versions, including a student version for under $100.

We’ll assume that MVC++ is installed in your system, and that you know how to start it by using the Windows Start button and navigating to the appropriate menu item.

You’ll want to make sure you can see file extensions (like .CPP) when operating MVC++. In Windows Explorer, make sure that the option Hide MS-DOS File Extensions for File Types That Are Registered is not checked.

Screen Elements

The MVC++ window is initially divided into three parts. On the left is the view pane. This has two tabs, ClassView and FileView. Once you have a project going, the ClassView tab will show you the class hierarchy of your program, and FileView will show you the files used in the project. You can click the plus signs to expand the hierarchies, and double-click a file you want to open.

The largest part of the screen usually holds a document window. It can be used for various purposes, including displaying your source files and the contents of help files. At the bottom of the screen is a long window with more tabs: Build, Debug, and so on. This will display messages when you perform operations such as compiling your program.

Single-File Programs

It’s easy to build and execute a single-file console program using Microsoft Visual C++. There are two possibilities: the file already exists or the file needs to be written.

In either case you should begin by making sure that no project is currently open. (We’ll discuss projects in a moment.) Click the File menu. If the Close Workspace item is active (not grayed) click it to close the current workspace.

Building an Existing File

If the .CPP source file already exists, as it does for the example programs in this book, select Open from the File menu. (Note that this is not the same as Open Workspace.) Use the Open dialog box to navigate to the appropriate file, select it, and click the Open button. The file will appear in the document window. (If you’re compiling an example program that uses Console Graphics Lite, such as the CIRCSTRC program in Chapter 5, “Functions,” or the CIRCLES program in Chapter 6, “Objects and Classes,” turn to the section “Building Console Graphics Lite Programs.”)