(Ebook) Ivor Horton's Beginning Visual C++ 2010 by Ivor Horton ISBN 9780470500880, 9780470651315, 0470500883, 0470651318 download
(Ebook) Ivor Horton's Beginning Visual C++ 2010 by Ivor Horton ISBN 9780470500880, 9780470651315, 0470500883, 0470651318 download
https://ebooknice.com/product/ivor-horton-s-beginning-
visual-c-2010-5399164
https://ebooknice.com/product/ivor-horton-s-beginning-visual-c-2010-wrox-
programmer-to-programmer-1688618
https://ebooknice.com/product/ivor-horton-s-beginning-visual-c-2012-2614418
https://ebooknice.com/product/ivor-horton-s-beginning-visual-c-2008-1021420
https://ebooknice.com/product/beginning-c-4144288
(Ebook) Beginning c by Horton, Ivor ISBN 9781430211884,
1430211881
https://ebooknice.com/product/beginning-c-11418750
https://ebooknice.com/product/ivor-horton-s-beginning-java-2347206
https://ebooknice.com/product/beginning-java-java-7-edition-ivor-
horton-11895298
https://ebooknice.com/product/beginning-c-11852658
https://ebooknice.com/product/ivor-horton-s-beginning-
java-2-jdk-5-edition-923710
Horton
Build real-world applications as Join the discussion @ p2p.wrox.com Wrox Programmer to Programmer™
®
samples from this book, as
programming skills well as code samples from
Ivor Horton is one of the preeminent authors of tutorials on the Java, C and C++
hundreds of other books, all
ready to use.
Ivor Horton’s
programming languages. He is widely known for his unique tutorial style, which
is readily accessible to both novice and experienced programmers. Horton is also
a systems consultant in private practice. He previously taught programming for
Read More
Find articles, ebooks, sample
Beginning
Visual C++ 2010
more than 25 years.
chapters, and tables of contents
for hundreds of books, and ®
Wrox Beginning guides are crafted to make learning programming languages more reference resources on
and technologies easier than you think, providing a structured, tutorial format programming topics that matter
that will guide you through all the techniques involved. to you.
wrox.com
one-stop resource.
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1193
Ivor Horton
ISBN: 978-0-470-50088-0
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108
of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers,
MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the
Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201)
748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or
promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work
is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services. If professional assistance is required, the services of a competent professional person should be sought. Neither
the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is
referred to in this work as a citation and/or a potential source of further information does not mean that the author or the
publisher endorses the information the organization or Web site may provide or recommendations it may make. Further,
readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this
work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available
in electronic books.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress
are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and
other countries, and may not be used without written permission. Visual C++ is a registered trademark of Microsoft
Corporation in the United States and/or other countries. All other trademarks are the property of their respective owners.
Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
MARC GREGOIRE is a software engineer from Belgium. He graduated from the Catholic University
Leuven, Belgium, with a degree in “Burgerlijk ingenieur in de computer wetenschappen” (equivalent
to Master of Science in Engineering in Computer Science). After that, he received the cum laude
degree of Master in Artificial Intelligence at the same university, started working for a big software
consultancy company (Ordina: http://www.ordina.be). His main expertise is C/C++, specifically
Microsoft VC++ and the MFC framework. Next to C/C++, Marc also likes C# and uses PHP
for creating web pages. In addition to his main interest for Windows development, he also has
experience in developing C++ programs running 24x7 on Linux platforms, and in developing critical
2G and 3G software running on Solaris for big telecom operators.
In April of the years 2007, 2008, and 2009 he received the Microsoft MVP (Most Valuable
Professional) award for his Visual C++ expertise.
Marc is an active member on the CodeGuru forum (as Marc G) and also wrote some articles
and FAQ entries for CodeGuru. He creates freeware and shareware programs that are distributed
through his website at www.nuonsoft.com and maintains a blog on www.nuonsoft.com/blog/.
THE AUTHOR IS ONLY ONE MEMBER of the large team of people necessary to get a book into print.
I’d like to thank the John Wiley & Sons and Wrox Press editorial and production teams for their
help and support throughout.
I would particularly like to thank my technical editor, Marc Gregoire, for doing such an
outstanding job of reviewing the text and checking out all the code fragments and examples in the
book. His many constructive comments and suggestions for better ways of presenting the material
has undoubtedly made the book a much better tutorial.
As always, the love and support of my wife, Eve, has been fundamental to making it possible for me
to write this book alongside my other activities. She provides for my every need and remains patient
and cheerful in spite of the effect that my self-imposed workload has on family life.
INTRODUCTION xxxiii
Defining Variables 49
Naming Variables 49
Declaring Variables 50
Initial Values for Variables 51
Fundamental Data Types 52
Integer Variables 52
Character Data Types 53
Integer Type Modifiers 55
The Boolean Type 56
Floating-Point Types 56
Literals 58
Defining Synonyms for Data Types 59
Variables with Specific Sets of Values 59
Basic Input/Output Operations 61
Input from the Keyboard 61
Output to the Command Line 62
Formatting the Output 63
Escape Sequences 64
Calculating in C++ 66
The Assignment Statement 66
Arithmetic Operations 67
Calculating a Remainder 72
Modifying a Variable 73
The Increment and Decrement Operators 74
The Sequence of Calculation 76
Type Conversion and Casting 78
Type Conversion in Assignments 79
Explicit Type Conversion 79
Old-Style Casts 80
The Auto Keyword 81
Discovering Types 81
The Bitwise Operators 82
The Bitwise AND 82
The Bitwise OR 84
The Bitwise Exclusive OR 85
The Bitwise NOT 86
The Bitwise Shift Operators 86
Introducing Lvalues and Rvalues 88
Understanding Storage Duration and Scope 89
Automatic Variables 89
Positioning Variable Declarations 92
xviii
Jos Jan olisi kuukausi takaperin tätä pyytänyt, niin siihen olisi tullut
halveksiva kielto. Ennen Garneyn retkeä vastaus luultavasti olisi
ollut: — Enpä tiedä — ei ole minulla aikaa, mutta nyt Kaleb oli
saanut hänestä toiset ajatukset, ja vastaus kuului:
GUIN VOITTOJUHLA
— Kuulepas nyt, Mäihä, sinä kun olet niin näppärä, etkö voisi
kiertää metsän kautta teidän puolellenne ja ryömiä apilan läpi, niin
että pääset vanhan murmelin ja sen pesän väliin? esitti ylipäällikkö.
— Hyvä.
— Niin kyllä; mutta mitä varten sen pitää tapahtua juuri neljän
aikaan?
Gui oikaisi kotia kohti niin sukkelaan kuin suinkin pääsi. Isä huusi
hänelle hänen puutarhaa lähestyessään ja ilmeisestikin hautoi
orjantöitä mielessään, mutta Gui hyökkäsi ruoka-arki-makuu-
keittiöhuoneeseen, joka oli anastanut yhdeksän kymmenesosaa koko
talosta.
— Voi äiti, sinun olisi pitänyt nähdä minut; sinun pitää tulla nyt
iltapäivällä — minä olen koko heimon numero yksi, ja nyt minusta
tehdään ylipäällikkö. Minä tapoin sen mahdottoman suuren vanhan
murmelin, joka oli vähällä tappaa isän. Ne pojat siellä leirissä — eivät
ne saa mitään aikaan ilman minua. Ne koettivat koettamistaan
enemmän kuin tuhannen kertaa saada sen vanhan murmelin — niin,
minä vaikka lyön vetoa, että he koettivat miljoonan kertaa, ja minä
vain odotin siksi, että he olivat väsyneet ja luopuivat koko jahdista,
ja silloin minä sanoin: no nyt minä näytän, kuinka se tapahtuu. Ensin
minun täytyi niille näyttää missä se oli. Ne toiset pojat eivät näe
paljon mitään. Sitten minä sanoin: No nyt, Sam ja Jan, jääkää te
pojat tähän, ja jotta te oikein näkisitte, kuinka helppoa se on, kun
osaa, minä jätän tähän jousen ja nuolet ja menen ihan ilman. Siihen
ne sitten jäivät minua katselemaan, ja minä h-i-i-v-i-n aidan läpi ja
minä r-y-ö-m-i-n apilamaan läpi aivan kuin intiaani, siksi että pääsin
sen ja pesän väliin, ja sitten minä luikkasin ja se tuli puhaltaen ja
hampaitaan kalistaen syödäkseen minut, sillä se näki, ettei minulla
ollut keppiä eikä mitään, enkä minä ollut tietävinänikään, pysyin
kylmäverisenä ja odotin, ja juuri kun sen piti hypätä minun
kurkkuuni kiinni, minä käännyin ja potkaisin sitä kuonoon, niin että
se lensi kymmenen syltä korkealle, ja kun se putosi alas, niin se oli
kuolleempi kuin Kilseyn kana, silloin kun sille sipulia syötettiin. Voi
äiti, minä olen paras niistä kaikista, eivät ne saa leirissä mitään
aikaan ilman minua. Minun täytyi opettaa ne hirveä ajamaan ja
katselemaan — ja — ja — paljon muuta, ja nyt ne tekevät minusta
koko heimon ylipäällikön ja antavat minulle nimeksi "Haukansilmä";
se on intiaanien tapa. Se tapahtuu kello neljä nyt iltapäivällä, ja
sinun pitää tulla katsomaan.
— Hyvää päivää, rouva Raften; toivon että voitte hyvin, hän sanoi
hieman pisteliäästi hymyillen ja tehden suurenmoisen yrityksen
saavuttaakseen yliotteen.
— Tässä on se nimi, jolla hän tunnettiin, ennen kuin hän oli suuri
ja kuuluisa, ja tämä on nyt sen lopun loppu. Päällikkö nakkasi
puupalikan tuleen ja sanoi: — No nyt nähdään, oletko sinä liian
vihanta pakaksesi. Pikku Majava antoi sitten Tikalle kauniin
kotkansulan, jossa oli punainen tupsu ja miehen kuva, miehellä
haukan pää ja nuoli päästä lentämässä. — Tämä näin on oikein
parasta laatua kotkansulka palkaksi niistä teoista, joita hän on
tehnyt, ja siinä myös osoitetaan, että hän on Haukansilmä (sulka
pistettiin Guin tukkaan ja kynsi-kaulakoriste hänen kaulaansa, ja joka
puolelta kuului äänekkäitä huutoja: — Hau — hau — hau, ja rumpua
paukutettiin), ja sen vietävän joka tämän jälkeen sanoo häntä
Mäihäksi, pitää kumartua ja Haukansilmän pitää potkaista häntä.
Sam oli unohtanut tämän asian, mutta hän kumarsi päänsä. Gui
katkaisi nauhan ja kohottaen päänahan ilmaan päästi kovan,
hirmuisen sotahuudon, jota jokainen säesti mikä mitäkin melua
pitäen. Tämä oli kaiken huippu. Rouva Burns itki ilosta, kun hänen
urhoollinen poikansa näin oli lopultakin saanut tunnustusta.
— No hyvä, minä en välitä siitä, kuka sinä olet, Raftenko vai et,
mutta sinulla on hyvä sydän ja se on oikeassa paikassa. Minä en ole
koskaan ollut niiden puolella, jotka sanovat, että "ei kenessäkään
Raftenissä ole mitään hyvää". Minä aina väitän, että jokaisessa
ihmisessä on jotakin hyvää. Minä tiedän, että sinun isäsi on ostanut
meidän talomme kiinnityksen, mutta sitä minä en ole koskaan
uskonut, että sinun äitisi varasti meidän hanhemme, enkä koskaan
sitä usko, ja kun minä ensi kerran kuulen puhuttavan Rafteneista
pahaa, niin minä avaan suuni ja sanon mitä tiedän.
XXII
PESUKARHUN METSÄSTYS
Inttäen, että kuluisi ainakin tunti, ennen kuin oltaisiin paikalla, Jan
sai joukon jo yhdeksän aikaan liikkeelle, ja Kaleb otti Guin
ehdotuksesta mukaan pienen kirveen. Pitäen vanhaa Turkkia kaiken
aikaa seurassaan he lähtivät astumaan maantietä ja kulkivat puolen
tuntia "Kulmausta" kohti. Samin johdolla he sitten kiipesivät aidan
yli, kulkivat perunapellon poikki ja tulivat joen rannalle pienelle
maissipellolle.
— No Turkki, hae nyt! Hae! Hae! Hae! ja joukko istui aidalle riviin
odottamaan mitä seuraisi.
— Lyön vetoa, että minä kuulin sen ensiksi, kimitti Gui. Janin
ensimmäinen ajatus oli hyökätä umpimähkään koiran perässä. Hän
oli usein kuullut, että metsästäjäin tapana oli rajusti seurata koirien
perässä, mutta Kaleb pidätti häntä.
Puro oli tätä nykyä melkein kuivilla, niin että sen poikki pääsi miltä
kohdalta vain halutti. Tunnustellen tietään pimeän metsän läpi silmät
enimmäkseen suljettuina he haparoiden kulkivat Boylen avokentälle
ja sitten sen poikki vanhaan metsään. Turkki oli purolla eronnut
heistä ja sitten seurannut sitä erääseen lammikkoon saakka, jossa se
meni uimaan. Heidän metsään mennessään koirakin saapui siihen
likomärkänä ja valmiina toimeen.
He olivat nyt kulkeneet niin kauas kotia kohti, että peltojen poikki
oikaisemalla olisivat äkkiä päässeet omaan metsään.
— Kunhan yritän.
— Eiköhän ole parasta ensin tehdä tuli, niin että näemme sen,
sanoi
Tikka.
Hän astui lähellä olevan pitkän hoikan puun luo, hakkasi sen
muutamassa minuutissa poikki kirveellään ja kaatoi sen sillä tavalla,
että se jäi ison niinipuun alimman oksan nojalle. Tätä pitkin Jan
pääsi helposti kiipeämään, vieden mukanaan vankan taakseen
sidotun jalavakepin. Kun hän oli päässyt isoon niinipuuhun, niin hän
katosi sen vihantiin lehviin, mutta pojat alhaalta valaisivat soihduilla
sillä tavalla, että hänelle kiersi valoa, minne hän vain kiipesikin. Ensin
Jan ei löytänyt koloa enempää kuin pesukarhuakaan, mutta kauan
etsittyään ylimmistä oksista hän näki suuren karvatukon korkealla
haarassa ja siitä kiilsi kaksi silmää, jotka saivat värähdyksen
käymään hänen lävitseen. Hän luikkasi: — Täällä se on! Pitäkää
varanne siellä alhaalla. Hän kiipesi lähemmäksi ja koetti sysätä
pesukarhun putoamaan, mutta se piteli lujasti kiinni eikä ollut
tietävinäänkään, ennen kuin hän oli kiivennyt yläpuolelle, silloin se
hyppäsi ja kapusi alemmalle oksalle.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com