Microsoft Visual C# 2013 Step by Step

Microsoft Visual C# 2013 Step by StepReviews
Author: John Sharp
Pub Date: 2013
ISBN: 978-0-7356-8183-5
Pages: 824
Language: English
Format: PDF/EPUB
Size: 22 Mb

Download

Expand your expertise—and teach yourself the fundamentals of Microsoft Visual C# 2013. If you have previous programming experience but are new to Visual C# 2013, this tutorial delivers the step-by-step guidance and coding exercises you need to master core topics and techniques.
Discover how to:
Create and debug C# applications in Visual Studio 2013
Work with variables, identifiers, statements, operators, and methods
Create interfaces and define abstract classes
Write robust code that can catch and handle exceptions
Display and edit data using data binding with Microsoft ADO.NET Entity Framework
Respond to user input and touchscreen gestures
Handle events arising from multiple sources
Develop your first Windows 8.1 apps

+

The forstatement in C# provides a more formal version of this kind of construct by combining the initialization, Boolean expression, and code that updates the control variable. You’ll find the forstatement useful because it is much harder to accidentally leave out the code that initializes or updates the control variable, so you are less likely to write code that loops forever. Here is the syntax of a for statement:

In Chapter 4, you saw how to use the breakstatement to jump out of a switchstatement. You can also use a breakstatement to jump out of the body of an iteration statement. When you break out of a loop, the loop exits immediately and execution continues at the first statement that follows the loop. Neither the update nor the continuation condition of the loop is rerun. In contrast, the continuestatement causes the program to perform the next iteration of the loop immediately (after reevaluating the Boolean expression). Here’s another version of the
example that writes the values 0 through 9 to the console, this time using breakand continue statements

You cannot use the checkedand uncheckedkeywords to control floatingpoint (noninteger) arithmetic. The checkedand uncheckedkeywords apply only to integer arithmetic using data types such as intand long. Floating-point arithmetic never throws OverflowException—not even when you divide by 0.0. (Remember from Chapter 2 that the .NET Framework has a special floating-point representation for infinity.)