TAILIEUCHUNG - c for engineers and scientists introduction to programming with ansi c phần 8

Biến con trỏ có thể được tăng lên, giảm đi, và so sánh. Số được thêm vào hoặc trừ từ một con trỏ sẽ được tự động thu nhỏ. Các yếu tố quy mô được sử dụng là số lượng byte cần thiết để lưu trữ các kiểu dữ liệu ban đầu viện định nghĩa chức năng và các mảng con trỏ định dạng Strings chung Chương trình Tóm tắt lỗi | 452 Chapter Ten Pointers declaration for the function can be either an array declaration or a pointer declaration. Thus the following argument declarations are equivalent float a float a 7. Pointer variables can be incremented decremented and compared. Numbers added to or subtracted from a pointer are automatically scaled. The scale factor used is the number of bytes required to store the data type originally pointed to. Character Strings Chapter Eleven String Fundamentals Pointers and Library Functions String Definitions and Pointer Arrays Formatting Strings Common Programming Errors Chapter Summary 453 454 Chapter Eleven Character Strings On a fundamental level strings are simply arrays of characters that can be manipulated using standard element-by-element array-processing techniques. On a higher level string library functions are available for treating strings as complete entities. This chapter explores the input manipulation and output of strings using both approaches. We will also examine the close connection between string-handling functions and pointers. String Fundamentals A string constant informally referred to as a string is any sequence of characters enclosed in double quotes. For example This is a string Hello World and xyz 123 @ are all strings. A string is stored as an array of characters terminated by a special end-of-string marker called the null character. The null character represented by the escape sequence 0 is the sentinel marking the end of the string. For example Figure 11-1 illustrates how the string Good Morning is stored in memory. The string uses fourteen storage locations with the last character in the string being the end-of-string marker 0. The double quotes are not stored as part of the string. Since a string is stored as an array of characters the individual characters in the array can be input manipulated or output using standard array-handling techniques utilizing either subscript or pointer .

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.