tailieunhanh - Module 5 Introducing FunctionsTable of ContentsCRITICAL SKILL 5.1: Know the general form of a

Module 5 Introducing Functions Table of Contents CRITICAL SKILL : Know the general form of a function 2 CRITICAL SKILL : Creating a Function 2 CRITICAL SKILL : Using Arguments . 3 CRITICAL SKILL : Using return . 5 CRITICAL SKILL : Using Functions in Expressions 9 CRITICAL SKILL : Local Scope 11 CRITICAL SKILL : Global Scope. | Module 5 Introducing Functions Table of Contents CRITICAL SKILL Know the general form of a CRITICAL SKILL Creating a CRITICAL SKILL Using CRITICAL SKILL Using CRITICAL SKILL Using Functions in CRITICAL SKILL Local CRITICAL SKILL Global CRITICAL SKILL Passing Pointers and Arrays to CRITICAL SKILL Returning CRITICAL SKILL Pass Command-Line Arguments to main .26 CRITICAL SKILL Function CRITICAL SKILL This module begins an in-depth discussion of the function. Functions are the building blocks of C and a firm understanding of them is fundamental to becoming a successful C programmer. Here you will learn how to create a function. You will also learn about passing arguments returning values local and global variables function prototypes and recursion. Function Fundamentals A function is a subroutine that contains one or more C statements and performs a specific task. Every program that you have written so far has used one function main . They are called the building blocks of C because a program is a collection of functions. All of the action statements of a program are found within functions. Thus a function contains the statements that you typically think of as being the executable part of a program. Although very simple programs such as many of those shown in this book will have only a main function most programs will contain several functions. In fact a large commercial program will define hundreds of functions. 1 C A Beginner s Guide by Herbert Schildt CRITICAL SKILL Know the general form of a function All C functions share a common form which is shown here return-type name parameter-list body of function Here return-type specifies the type of data returned by the function. This can be any valid type except an array. If the function does not return a value its return type must be void. .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.