TAILIEUCHUNG - C for Dummies 2nd edition phần 4

bạn có thể sẽ tạo ra chức năng của riêng bạn đọc các thông tin bàn phím và màn hình hiển thị theo cách bạn như thế nào. Cho đến lúc đó, bạn đang mắc kẹt với những gì C cung cấp. Chương này giới thiệu đơn giản () và đặt () chức năng. () đọc một chuỗi văn bản từ bàn phím, và đặt () hiển thị một chuỗi văn bản trên màn hình. | 106 Part II Run and Scream from Variables and Math Real live constant variables Using define to create a constant for use throughout your program is a handy thing to do. In fact I recommend using it whenever you have something in your program that you figure may change. For example define NUMBER_OF_USERS 3 define COLUMN_WIDTH 80 define US_STATES 50 Each of these examples makes it possible to change aspects of your entire program merely by editing a single define declaration. But are they really constants the opposite of variables No That s because they have the const keyword which converts a mild-mannered variable into an unyielding constant. To wit const int senses 6 The preceding statement creates a variable named senses but fixes that variable s value at 6. The value cannot be changed or used for something else later in the program if you try a read-only variable error pops up. Most often you don t see const used to create constant values. Instead this statement is quite common const char prompt Your command This statement creates the string variable prompt and sets its contents equal to Your command . The const keyword ensures that this variable cannot be reused or its contents ever changed a good idea for this type of variable. Chapter 9 How to C Numbers Jn This Chapter Using different variables for different numbers Understanding the long and short of i nt Knowing your signed and unsigned variables Floating a number Double floating a number Formatting a huge value ut on your safety goggles my greenhorn companion I have danced around the flaming inferno of numbers far too long. It s time to dive headlong into that hellfire of values and digits. Far down from the comfy safety of the int lie numbers large and loathsome. Terrifying values you can gingerly place into your puny programs. Numbers lethal and toxic but which you can also tame as long as you obey my gentle advice in this chapter. Fear not Instead don your asbestos suit and follow me. Watch your step. .

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.