B. Which statement would be used to define a to element integer array c? a. Arra
ID: 3760026 • Letter: B
Question
B. Which statement would be used to define a to element integer array c? a. Array c = int[10]; b. C = int[10]; c. int Array c[10]; d. int c[10]; 17. Declare an Integer pointer variable named int_ptr. 18. Use the pointer created in question 17 and assign it the memory location of a variable named int_var. 19. Suppose you have an executable program named count that counts the characters in its input. Devise a command-line command using the count program to count the number of characters in the file essay and to store the result in a file named essayct 20. Compare and contrast pass-by-value and pass-by-referenceExplanation / Answer
20)
Pass By Reference :
In Pass by reference address of the variable is passed to a function. Whatever changes made to the formal parameter will affect to the actual parameters
- Same memory location is used for both variables.(Formal and Actual)-
- it is useful when you required to return more then 1 values
Pass By Value:
- In this method value of the variable is passed. Changes made to formal will not affect the actual parameters.
- Different memory locations will be created for both variables.
- Here there will be temporary variable created in the function stack which does not affect the original variable.
17)
int * intptr = &intVar;
16)
d.int c[ 10 ];
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.