1) 4 pts. 2) 4 pts. 3) 4 pts. In C++ what type of function is preferred to a mac
ID: 3914827 • Letter: 1
Question
1) 4 pts. 2) 4 pts. 3) 4 pts. In C++ what type of function is preferred to a macro? What is the benefit of accessor functions? Circle all of the items that the compiler examines in order to select the proper overloaded function. 1. The location of the function within the source code. 2. The number of arguments in the function call. 3. The return type of the function. 4. Types and order of the arguments in the function call. Create code for the following variables: An integer trees. 4) 4 pts. A constant pointer to trees. 5) 4 pts. The following code doesn't compile. Fix it int x=0; const int y 10; int& r3 = y; In the previous example, what are rl and r3 examples of? 6) 4 pts.Explanation / Answer
As it is chegg policy to answer one question per answer or four sub-questions. Hence, I am answering the four sub-questions and request you to post rest of the question as another question.Thankyou.
1. Macros
2.Benefits of Accessor Methods:
3. The right options are as follows:
The main reason behind this two options to be correct is that the arguments decide whether the function is to be overloaded or not and the type of the argument in the function call can be used to overload an function.
4. The program would look as written below:
Code:
int main(){
int tree=0;
int *const ptr = &tree;
printf("%d",ptr);
return 0;
}
Hence, these are the answer to above asked questions.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.