Chapter 6 explained that when an argument is passed by value, a copy o dịch - Chapter 6 explained that when an argument is passed by value, a copy o Việt làm thế nào để nói

Chapter 6 explained that when an ar

Chapter 6 explained that when an argument is passed by value, a copy of the argument in the function call is made and passed to the function. If the copy is modified in the func- tion, the original value in the caller does not change. In many cases, a value passed to a func- tion is modified in that function. However, in some instances, the value should not be altered in the called function, even though the called function manipulates only a copy of the original value.
Consider a function that takes a one-dimensional array and its size as arguments and subsequently prints the array. Such a function should loop through the array and output each element individually. The size of the array is used in the function body to determine the array’s highest subscript so the loop can terminate when the printing completes. The array’s size does not need to change in the function body, so it should be declared const to ensure that it will not change. Because the array is only being printed, it, too, should be declared const. This is especially important because arrays are always passed by reference and could easily be changed in the called function. If an attempt is made to modify a const value, an error occurs.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Chapter 6 explained that when an argument is passed by value, a copy of the argument in the function call is made and passed to the function. If the copy is modified in the func- tion, the original value in the caller does not change. In many cases, a value passed to a func- tion is modified in that function. However, in some instances, the value should not be altered in the called function, even though the called function manipulates only a copy of the original value.Consider a function that takes a one-dimensional array and its size as arguments and subsequently prints the array. Such a function should loop through the array and output each element individually. The size of the array is used in the function body to determine the array’s highest subscript so the loop can terminate when the printing completes. The array’s size does not need to change in the function body, so it should be declared const to ensure that it will not change. Because the array is only being printed, it, too, should be declared const. This is especially important because arrays are always passed by reference and could easily be changed in the called function. If an attempt is made to modify a const value, an error occurs.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Chương 6 giải thích rằng khi một đối số được truyền theo giá trị, một bản sao của các đối số trong lời gọi hàm được thực hiện và truyền cho hàm. Nếu các bản sao được sửa đổi trong sự hàm, giá trị ban đầu trong việc gọi không thay đổi. Trong nhiều trường hợp, một giá trị thông qua với một hàm được sửa đổi trong chức năng đó. Tuy nhiên, trong một số trường hợp, giá trị nên không thể thay đổi trong chức năng gọi, mặc dù được gọi là chức năng thao tác chỉ là một bản sao của các giá trị ban đầu.
Hãy xem xét một chức năng mà phải mất một mảng một chiều và kích thước của nó như các đối số và sau đó in ra mảng. Một chức năng như vậy nên lặp qua mảng và sản lượng mỗi yếu tố riêng lẻ. Kích thước của mảng được sử dụng trong các cơ quan chức năng để xác định subscript cao nhất của mảng để vòng lặp có thể chấm dứt khi in xong. Kích thước của mảng không cần phải thay đổi trong cơ thể chức năng, vì vậy nó cần được khai báo const để đảm bảo rằng nó sẽ không thay đổi. Bởi vì mảng này chỉ được in, nó cũng cần được khai báo const. Điều này đặc biệt quan trọng bởi vì các mảng luôn luôn thông qua tham khảo và có thể dễ dàng được thay đổi trong chức năng gọi. Nếu một nỗ lực được thực hiện để sửa đổi một giá trị const, lỗi xảy ra.
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: