Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Essential C# 3.0 FOR NET FRAMEWORK 3.5 PHẦN 3
Đang chuẩn bị liên kết để tải về tài liệu:
Essential C# 3.0 FOR NET FRAMEWORK 3.5 PHẦN 3
Tuyết Xuân
72
87
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
nó tiến triển dễ dàng vào các góc được biết đến ít hơn các ngôn ngữ, khiến cho này cuốn sách không thể thiếu với bất kỳ mức độ của C # phát triển "Troy Magennis, C # MVP và tác giả của HookedOnLINQ.com". Nếu bạn là người mới đến C #, như tôi, cuốn sách của Mark là một cách tuyệt vời để bắt đầu. | Control Flow Statements Continued 129 jump expression is a jump statement such as a break or goto statement. If the switch statement appears within a loop then continue is also allowed. A switch statement must have at least one case statement or a default statement. In other words switch x is not valid. Listing 3.46 with a switch statement is semantically equivalent to the series of if statements in Listing 3.45. Listing 3.46 Replacing the if Statement with a switch Statement static bool ValidateAndMove int playerPositions int currentPlayer string input bool valid false Check the current player s input. switch input case 1 case 2 case 3 case 4 case 5 case 6 case 7 case 8 case 9 Save move as the player directed. . valid true break case case quit valid true break default If none of the other case statements is encountered then the text is invalid. System.Console.WriteLine nERROR Enter a value from 1-9. Push ENTER to quit break return valid 130 Chapter 3 Operators and Control Flow In Listing 3.46 input is the governing type expression. Since input is a string all of the constants are strings. If the value of input is 1 2 . 9 then the move is valid and you change the appropriate cell to match that of the current user s token X or O . Once execution encounters a break statement it immediately jumps to the statement following the switch statement. The next portion of the switch looks for or quit and sets valid to true if input equals one of these values. Ultimately the default label is executed if no prior case constant was equivalent to the governing type. There are several things to note about the switch statement. Placing nothing within the switch block will generate a compiler warning but the statement will still compile. default does not have to appear last within the switch statement. case statements appearing after default are evaluated. When you use multiple constants for one case statement they should appear consecutively as shown in Listing 3.46. The compiler .
TÀI LIỆU LIÊN QUAN
Essential C# 4.0
Ebook Essential practical NMR for organic chemistry: Part 1 - S. A. Richards, J. C. Hollerton
Ebook Essential practical NMR for organic chemistry: Part 2 - S. A. Richards, J. C. Hollerton
Essential SNMP, Second Editio
Essential SNMP, Second Edition
Essential SQLAlchemy
Pro .NET 4 Parallel Programming in C#
Addison Wesley Essential C++
Cocos2d for iPhone 0.99 Beginner's Guide
Windows Phone 7.5: Building Location-aware Applications
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.