TAILIEUCHUNG - Apress accelerared C# 2010_2

Tham khảo tài liệu 'apress accelerared c# 2010_2', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | CHAPTER 3 C SYNTAX OVERVIEW public class EntryPoint . . . . static void Main var myList new List int Won t compile Error CS0029 Compiler developers typically take this problem extremely seriously and sometimes won t even introduce a new keyword if it could possibly break existing code. However the C compiler developers have a trump card. If you follow the recommended conventions for naming .NET types with an initial capital letter you ll never find yourself in this situation. Additionally if you use Visual Studio code analysis or FxCop the stand-alone version of code analysis during the development of your application you will never encounter this problem. These rules and guidelines are also covered in detail in Framework Design Guidelines Conventions Idioms and Patterns for Reusable .NET Libraries by Krzysztof Cwalina and Brad Abrams Boston MA Addison-Wesley Professional 2005 . I highly recommend you read their book if you have not already. Type Conversion Many times it s necessary to convert instances of one type to another. In some cases the compiler does this conversion implicitly whenever a value of one type is assigned from another type that when converted to the assigned type will not lose any precision or magnitude. In cases where precision could be lost an explicit conversion is required. For reference types the conversion rules are analogous to the pointer conversion rules in C . The semantics of type conversion are similar to both C and Java. Explicit conversion is represented using the familiar casting syntax that all of them inherited from C that is the type to convert to is placed in parentheses before whatever needs to be converted int defaultValue 12345678 long value defaultValue int smallerValue int value In this code the int cast is required to be explicit since the underlying size of an int is smaller than a long. Thus it s possible that the value in the long may not fit into the space available to the int. The assignment from the defaultValue .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.