Professional C 3rd ed Edition Simon Robinsoninstant download
Professional C 3rd ed Edition Simon Robinsoninstant download
https://ebookultra.com/download/professional-c-3rd-ed-
edition-simon-robinson/
https://ebookultra.com/download/professional-javascript-for-web-
developers-3rd-edition-nicholas-c-zakas/
https://ebookultra.com/download/the-treatment-of-epilepsy-3rd-ed-
edition-simon-d-shorvon/
https://ebookultra.com/download/professional-javascript-for-web-
developers-2nd-ed-edition-nicholas-c-zakas/
https://ebookultra.com/download/dairy-microbiology-handbook-the-
microbiology-of-milk-and-milk-products-3rd-edition-richard-k-robinson-
ed/
Mozart 1 ed. Edition Simon P. Keefe (Ed.)
https://ebookultra.com/download/mozart-1-ed-edition-simon-p-keefe-ed/
https://ebookultra.com/download/financial-modeling-3rd-edition-simon-
benninga/
https://ebookultra.com/download/timber-designers-manual-3rd-ed-
edition-e-c-ozelton/
https://ebookultra.com/download/handbook-of-biodegradable-
polymers-3rd-edition-bastioli-c-ed/
https://ebookultra.com/download/an-introduction-to-ordinary-
differential-equations-james-c-robinson/
Professional C 3rd ed Edition Simon Robinson Digital
Instant Download
Author(s): Simon Robinson; et al
ISBN(s): 9780764571961, 0764571966
Edition: 3rd ed
File Details: PDF, 12.41 MB
Year: 2004
Language: english
Professional C#
Third Edition
Simon Robinson
Christian Nagel
Jay Glynn
Morgan Skinner
Karli Watson
Bill Evjen
Professional C#
Third Edition
Professional C#
Third Edition
Simon Robinson
Christian Nagel
Jay Glynn
Morgan Skinner
Karli Watson
Bill Evjen
Professional C#, Third Edition
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2004 by Wiley Publishing, Inc., Indianapolis, Indiana. All rights reserved.
Published simultaneously in Canada
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 Section 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 Clear-
ance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the
Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Cross-
point Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4447, E-mail: permcoordinator@wiley.com.
For general information on our other products and services please contact our Customer Care Department
within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley Publishing logo, Wrox, the Wrox logo, and Programmer to Programmer are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates. 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.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not
be available in electronic books.
Library of Congress Control Number: 2004103177
ISBN: 0-7645-5759-9
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
About the Authors
Simon Robinson
Simon Robinson is the editor-in-chief of ASP Today, one of the leading sites
related to Web programming on the Windows platform.
He has an extremely broad experience of programming on Windows. These days his core specialty is .NET
programming. He is comfortable coding in C++, C#, VB, and IL, and has skills ranging from graphics and
Windows Forms to ASP.NET to directories and data access to Windows services and the native Windows API.
Simon lives in Lancaster, UK. His outside interests include theater, dance, performing arts, and politics.
You can visit Simon’s Web site, http://www.SimonRobinson.com.
Christian Nagel
Christian Nagel is an independent software architect and developer who
offers training and consulting on how to design and develop Microsoft .NET
solutions. He looks back to more than 15 years’ experience as a developer
and software architect. Christian started his computing career with PDP 11
and VAX/VMS platforms, covering a variety of languages and platforms.
Since the year 2000—when .NET was just a technology preview—he has
been working with various .NET technologies to build distributed solutions.
With his profound knowledge of Microsoft technologies, he has also written
numerous .NET books; is certified as Microsoft Certified Trainer (MCT),
Solution Developer (MCSD), and Systems Engineer (MCSE); and is the
Microsoft Regional Director for Austria. Christian is a speaker at international conferences (TechED,
DevDays, VCDC) and is the regional manager of INETA Europe (International .NET User Group
Association) supporting .NET user groups. You can contact Christian via his Web site,
http://www.christiannagel.com.
Jay Glynn
Jay Glynn started writing software nearly 20 years ago, writing applications
for the PICK operating system using PICK basic. Since then, he has created
software using Paradox PAL and Object PAL, Delphi, VBA, Visual Basic, C,
C++, Java, and of course C#. He is currently a Project coordinator and
Architect for a large financial services company in Nashville, Tennessee,
working on software for the TabletPC platform. He can be
contacted at jlsglynn@hotmail.com.
Morgan Skinner
Morgan Skinner began his computing career at a tender age on a Sinclair
ZX80 at school, where he was underwhelmed by some code a teacher had
written and so began programming in assembly language. After getting
hooked on Z80 (which he believes is far better than those paltry 3 registers on
the 6502), he graduated through the school’s ZX81s to his own ZX Spectrum.
Since then he’s used all sorts of languages and platforms, including VAX
Macro Assembler, Pascal, Modula2, Smalltalk, X86 assembly language,
PowerBuilder, C/C++, VB, and currently C#. He’s been programming in
.NET since the PDC release in 2000, and liked it so much, he joined Microsoft in 2001. He now works in
Premier Support for Developers and spends most of his time assisting customers with C#.
Karli Watson
Karli Watson is a freelance author and the technical director of 3form Ltd
(http://www.3form.net). Despite starting out by studying nanoscale
physics, the lure of cold, hard cash proved too much and dragged Karli into
the world of computing. He has since written numerous books on .NET and
related technologies, SQL, mobile computing, and a novel that has yet to see
the light of day (but that doesn’t have any computers in it). Karli is also
known for his multicolored clothing, is a snowboarding enthusiast, and still
wishes he had a cat.
Bill Evjen
Bill Evjen is an active proponent of the .NET technologies and community-
based learning initiatives for .NET. He has been actively involved with .NET
since the first bits were released in 2000 and has since become president of
the St. Louis .NET User Group (http://www.stlusergroups.org). Bill is
also the founder and executive director of the International .NET ssociation
(http://www.ineta.org), which represents more than 125,000 members
worldwide. Based in St. Louis, Missouri, USA, Bill is an acclaimed author
and speaker on ASP.NET and XML Web services. He has written XML Web
Services for ASP.NET, Web Services Enhancements: Understanding the WSE for
Enterprise Applications, Visual Basic .NET Bible, and ASP.NET Professional
Secrets (all published by Wiley). Bill is a Technical Director for Reuters, the
international news and financial services company. He graduated from Western Washington University
in Bellingham, Washington, with a Russian language degree. You can reach Bill at evjen@yahoo.com.
Contributor
Allen Jones
Allen Jones has a career spanning 15 years that covers a broad range of IT disciplines, including enter-
prise management, solution and enterprise architecture, and project management. But software develop-
ment has always been Allen’s passion. Allen has architected and developed Microsoft Windows–based
solutions since 1990, including a variety of e-commerce, trading, and security systems.
Allen has co-authored four popular .NET books including the C# Programmer's Cookbook (Microsoft
Press) and Programming .NET Security (O’Reilly), and he is actively involved in the development of
courseware for Microsoft Learning covering emerging .NET technologies.
Credits
Vice President and Executive Group Publisher Editorial Manager
Richard Swadley Kathryn A. Malm
Acquisitions Editors
Sharon Cox
Katie Mohr
Contents
Introduction xxvii
Chapter 2: C# Basics 29
Before We Start 30
Our First C# Program 30
The Code 30
Compiling and Running the Program 31
Contents
A Closer Look 31
Variables 34
Initialization of Variables 34
Variable Scope 35
Constants 38
Predefined Data Types 39
Value Types and Reference Types 39
CTS Types 40
Predefined Value Types 41
Predefined Reference Types 44
Flow Control 47
Conditional Statements 47
Loops 51
Jump Statements 54
Enumerations 55
Arrays 57
Namespaces 58
The using Statement 59
Namespace Aliases 60
The Main() Method 61
Multiple Main() Methods 61
Passing Arguments to Main() 62
More on Compiling C# Files 63
Console I/O 65
Using Comments 67
Internal Comments Within the Source Files 67
XML Documentation 68
The C# Preprocessor Directives 70
#define and #undef 70
#if, #elif, #else, and #endif 71
#warning and #error 72
#region and #endregion 72
#line 72
C# Programming Guidelines 73
Rules for Identifiers 73
Usage Conventions 74
Summary 81
xi
Contents
Operator Precedence 137
Type Safety 137
Type Conversions 138
Boxing and Unboxing 141
Comparing Objects for Equality 142
Comparing Reference Types for Equality 142
The ReferenceEquals() Method 142
The virtual Equals() Method 143
The static Equals() Method 143
Comparison Operator (==) 143
Comparing Value Types for Equality 143
Operator Overloading 144
How Operators Work 145
Operator Overloading Example: The Vector Struct 146
Which Operators Can You Overload? 153
User-Defined Casts 154
Implementing User-Defined Casts 155
Multiple Casting 161
Summary 165
xii
Exploring the Variety of Random
Documents with Different Content
direction. This is illustrated by the large rotary presses in the picture
of the pressroom, one of which, the four-cylinder, has just been
removed to make way for presses adapted to finer magazine work.
There is still in the rotary press the necessity of feeding by hand. A
number of machines have been invented to feed themselves from a
roll of paper, thus introducing another rotary motion, and to "deliver"
the paper by still another rotary process. None of these presses, so
far, have come to such perfection as to print from type as well and
as fast as the great rotary press now used by the Witness, but they
are constantly improving in construction. Such presses have, of
course, to print one side of the paper and then the other before the
sheet leaves the press, and would have to deliver these perfected
sheets as fast from one exit as the rotary does from eight or ten. It
is in these points where the difficulty is found, as one side has to be
printed before the ink is dry on the other, and the rapid disposal of
the finished papers requires very ingenious machinery. There are
further improvements still in the future. We can imagine lithography
completely supplanting type or stereotype printing,—as it has begun
to do,—the impression of the type being transferred to stone, or
some other lithographic surface. If lithographic surfaces could be
made cylindrical they could, being smooth, work against each other,
and so print both sides of the paper at the same time. The whole
press would thus consist of two impression rollers and two more to
ink them going round just as fast as the chemical character of the
ink would permit. The Witness has had to purchase a new machine
about every five years to keep up with the times, and it is not
probable that it will be otherwise in the future.
HOISTING "TURTLE" ON THE PRESS.
As the sheets are printed they are gathered from each of the eight
receiving tables and carried off to the folding machines, of which
there are four on the same flat. These are unable to do all the work
as quickly as required, so that some are sent up to the bindery
above, and folded by hand.
Let us, for a moment, consider the amount of paper which goes
through the presses on this floor in a year. There are, devoted to
papers, an eight-cylinder rotary for the Daily, a two-cylinder for the
Weekly Witness, and a single-feeder for the Messenger. There are also
several presses for job work, one of which, however, prints L'Aurore,
and another the New Dominion Monthly, which need not now be
referred to in detail.
A FELLOW LABORER.
Some fourteen thousand five hundred copies of the Daily Witness are
printed daily, or 4,509,500 a year, excluding from the calculation
Sundays and legal holidays. The circulation of the Weekly Witness
averages twenty-six thousand copies, or 1,412,000 in a year. Some
fifty thousand copies of the Northern Messenger are issued semi-
monthly, or 1,200,000 sheets a year. Thus the total mounts up to
more than seven million papers which are printed on these premises
during a year. A few statistics with this number as a basis would
prove interesting. Piled in reams these papers would form a column
3,560 feet high, or more than two-thirds of a mile. Stretched out and
pasted together they would reach four thousand four hundred and
twenty-one miles. But such figures as these simply daze one, and we
will leave them and follow the papers a little farther.
ANSWERING AN ADVERTISEMENT.
But the Daily Post informs the public that "this was five days before
he did die, and £40,000 more than he died worth."
"To be disposed of, for the benefit of the poor widow, a Blind
Man's Walk in a charitable neighborhood, the comings-in
between twenty-five and twenty-six shillings a week, with a dog
well drilled, and a staff in good repair. A handsome premium will
be expected. For further particulars inquire at No. 40, Chiswell
street."
This was inserted in the space reserved for death notices, and really
deserved some obituary poetry.
During December and January the department in a newspaper office
busy above all others is the one where the subscriptions are received
and the lists attended to.
COUNTING ROOM.
The immense amount of work which comes under this head has
been previously referred to. A few statistics will render it more clear.
During the year ending February, 1877, twenty-two thousand seven
hundred and seventy-three money letters passed through this
department in the Witness office, while as many more, having
reference to changes, instructions, giving advice, etc., were attended
to. Some of these letters are of an extraordinary nature. In one
instance, on a day when some eight hundred money letters poured
into the department, the writer signed his name after the manner of
an enigma. It was interesting, but out of place. People sometimes
send letters with the statement, "Of course you know my name, as
you sent me a circular," or something similar. Others sign their
names without giving any post-office address, while many again give
two addresses, one at the head and the other at the foot of their
letters. Sometimes the amount required to be sent is enclosed with
no other intimation; but more frequently still the letters, names and
all, are sent without the money.
By an ingenious method all money letters which come into this
department are numbered, the amount received and the page of
cash book where entered marked upon them, and then filed away in
books of one hundred, which are bound together, so that any
particular letter can be turned up in an instant and referred to. The
cash book is ruled so as to give a column for the Daily Witness,
Weekly Witness, Northern Messenger, New Dominion Monthly, and
Aurore, and the total amount; and sometimes one single letter
contains a subscription for every one of the papers enumerated,
while a very large proportion have at least two of them. There are a
very large number of subscribers who, year after year, take these
papers, and not satisfied with this evidence of goodwill, make a
point of sending several other subscriptions along with their own. It
is always pleasant to the publisher to hear from these, and their
letters constantly recurring, year by year, are like the visits of old
friends.
It would be impossible to leave this department without a reference
to a minor one partially connected with it—that having charge of the
premiums. It is desired, as far as possible, to give some return for all
favors done. But here arises a difficulty. Most of these favors are
simply because of the goodwill of the performers, and any direct
return would be anything but pleasing to them. Thus the rule has
been made that those who desire to work for prizes must, in some
way, indicate their desire, and the manner considered most
satisfactory is to have the words "In competition" written on the top
of all letters containing money intended for the prizes. The names of
those who send such letters are entered in a separate book ruled in
columns, and the remittances are recorded one after the other, so
that when the last is sent in the total can be checked in an instant.
The number of prizes given in a year is nothing inconsiderable. The
following is merely a partial list of what were sent out in the winter
of 1877-78:—236 pairs of skates; 30 gold lockets; 125 gold rings; 40
photograph albums; 82 Pool's weather glass and thermometer
combined; 6 magic lanterns; 4 McKinnon pens; 298 chromos of Lady
Dufferin and 327 of the Earl of Dufferin.
GRAVERS' TOOLS
We will now rapidly run through the Witness office. It occupies two
large, three-story buildings, one fronting on St. Bonaventure street,
Montreal, and the other extending back almost to Craig street in the
rear. These two buildings are united by an enclosed space, which is
utilized as an engine-room and storehouse. This portion is covered
with a glass roof to give light to both of the buildings, which are
connected by bridges ornamented with flowers and musical with the
songs of birds, as suggested by the engraving. Entering by the front
door from St. Bonaventure street is the business office. Ascending
the large staircase shown, the editorial and reporting rooms are
reached. In the latter is the library for the use of the Witness
employees, containing over one thousand volumes. These books are
lent free to all engaged in the office desirous of reading them. The
principal English, American and Canadian papers are also kept on
file. On the same flat is the correspondence department,—in which
young ladies do most of the work,—the engraving department, the
editor of the Aurore, and the desk of the mechanical manager. Going
up stairs still higher, the "news" room is reached, where the
compositors of the Daily Witness perform their duties. The managing
editor and the proof-readers monopolize a corner of this room.
Crossing one of the bridges previously referred to, the electrotyping
department is seen occupying a partitioned-off corner of the very
large and airy "job" office, where are the compositors of the Dominion
Monthly, and where any amount of pamphlets, books, and of job
work is turned out each year. Taking the hoist we descend to the
next floor, which is occupied by the binding and folding room. Here
also the mailing lists are kept and scores of "chases" full of names
are to be seen, as well as the machines for mailing the papers. This
room is the one shown in the illustration of the dinner to the
newsboys, the tables, however being covered with something, to
them, more attractive than sheets of pamphlets, while the walls are
draped with the national flags. This room has been formally devoted
to any reunions the employees may decide to hold for their own
entertainment. Descending still another story, we reach the
pressroom, where the huge eight feeder, nineteen feet high, thirty
feet long and six broad, is turning out sixteen thousand printed
sheets an hour. The double building occupies 7,300 feet of ground
and 20,400 feet of flooring, besides cellarage.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
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.
ebookultra.com