TAILIEUCHUNG - C Programming for Scientists & Engineers phần 2

- Biểu tượng được gọi là địa chỉ của người điều khiển. Khi nó được đưa vào phía trước của một biến, nó được vị trí trong bộ nhớ mà biến đó được lưu trữ. Do đó, & A nên được đọc là "địa chỉ (trong bộ nhớ) của biến được gọi là A '. Nhà điều hành & cần thiết khi chúng ta sử dụng fscanf vì fscanf chỉ có thể đặt các dữ liệu | Variables data types and declaration statements 9 control string in this example is a formatting code that instructs fscanf to interpret the data that it reads from the keyboard as a character. The third argument A instructs fscanf to store the character that it has read in a variable called A. It is very important to note that the symbol has been used in front of the name of the variable. The symbol is called the address of operator. When it is put in front of a variable it gets the location in memory where the variable is stored. Hence A should be read as the address in memory of the variable called A . The operator is needed when we use fscanf because fscanf can only put the data that it reads into specific places in memory. More importantly fscanf needs to be told where to put the data that it reads. The easiest way to do this is to declare a variable beforehand and to say put the data at the address of that variable . The overall effect of this is to store the character supplied from the keyboard in the variable A. When fscanf has done its job the program then calls the fprintf function again. This time fprintf has to display a message on the screen that contains the contents or value of variable A. The message to be displayed is inside the control string which is the second argument. Inside the control string the formatting code c indicates where the value of 4 will be inserted into the message and that the value to be inserted is of type char. The conưol string also contains the symbols rì which together are a control code that forces the cursor to go to the start of the next line on the screen. The third argument specifies the variable A whose value is to replace c in the message. Tutorial Implement Program . Write brief notes on the action of each statement in he program. Tutorial Modify Program to store the character data in a variable called character_data. 10 c programming for scientists and engineers The integer data type Integer .

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.