Final Study Guide The final will be comprehensive and cover chapters 1- 8 in the
ID: 3576149 • Letter: F
Question
Final Study Guide
The final will be comprehensive and cover chapters 1- 8 in the text.
Use the study guides for the first 2 midterm.
The final will have true/false, multiple choice and code questions.
Arrays (Chapter 7)
Structure
indexes
in memory
Declaration
Initializing
Passed to functions
Const parameter
Usage with for loops
Partially Filled
String and Vectors (Chapter 8)
Array type strings
Values and variables
Assignment vs equal to
cstring functions
strcpy, strncpy
strcmp, strncmp
strcat, strncat
strlen
input and output
Number conversion
String class
I/O
Getline
String processing
Convertion to cstrings
Vectors
Declaration
Assignment
Functions
push_back
size
Size and capacity
Given function descriptions, write functions using arrays, strings and vectors.
Explanation / Answer
A perform definition in C programming consists of a perform header and a perform body. Here square measure all the components of a perform
Return sort A perform might come back a worth. The return_type is that the information form of the worth the perform returns. Some functions perform the specified operations while not returning a worth. during this case, the return_type is that the keyword void.
Function Name this is often the particular name of the perform. The perform name and therefore the parameter list along represent the perform signature.
Parameters A parameter is sort of a placeholder. once a perform is invoked, you pass a worth to the parameter. This worth is spoken as actual parameter or argument. The parameter list refers to the kind, order, and variety of the parameters of a perform. Parameters square measure optional; that's, a perform might contain no parameters.
Function Body The perform body contains a set of statements that outline what the perform will.
Example
Given below is that the ASCII text file for a perform known as max(). This perform takes 2 parameters num1 and num2 and returns the utmost worth between the 2
/* perform returning the GHB between 2 numbers */
int max(int num1, int num2) native variable declaration */
int result;
if (num1 > num2)
result = num1;
else
result = num2;
come back result;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.