TAILIEUCHUNG - A Complete Guide to Programming in C++ part 7

A Complete Guide to Programming in C++ part 7. This book provides both novice and experienced programmers with a comprehensive resource manual for the C++ programming language. Readers gain experience in all aspects of programming, from elementary language concepts to professional software development, with in depth coverage of all the language elements en route. These elements are carefully ordered to help the reader create useful programs every step of the way. | chapter 3 Using Functions and Classes This chapter describes how to declare and call standard functions and use standard classes. This includes using standard header files. In addition we will be working with string variables . objects belonging to the standard class string for the first time. Functions and classes that you define on your own will not be introduced until later in the book. 39 40 CHAPTER 3 USING FUNCTIONS AND CLASSES DECLARING FUNCTIONS The prototype above yields the following information to the compiler func is the function name the function is called with two arguments the first argument is of type int the second of type double the return value of the function is of type long. Mathematical standard functions double sin double Sine double cos double Cosine double tan double Tangent double atan double Arc tangent double cosh double Hyperbolic Cosine double sqrt double Square Root double pow double double Power double exp double Exponential Function double log double Natural Logarithm double logl 0 double Base-ten Logarithm DECLARING FUNCTIONS 41 Declarations Each name identifier occurring in a program must be known to the compiler or it will cause an error message. That means any names apart from keywords must be declared . introduced to the compiler before they are used. Each time a variable or a function is defined it is also declared. But conversely not every declaration needs to be a definition. If you need to use a function that has already been introduced in a library you must declare the function but you do not need to redefine it. Declaring Functions A function has a name and a type much like a variable. The function s type is defined by its return value that is the value the function passes back to the program. In addition the type of arguments required by a function is important. When a function is declared the compiler must therefore be provided with information on the name and type of the function and the type of each argument. .

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.