1. For the declarations below, which expression is TRUE if ptr1
and ptr2 point at the same object?
int *ptr1;
int *ptr2;
a. ptr1 == ptr2
b. None of the above is true
c. ptr1 != ptr2
d. &ptr1 == &ptr2
a. ptr1 == ptr2 is true. ptr1 and ptr2 represent the address of the object. They both represent the same object. so, It gives TRUE.
Option c.ptr1!=ptr2 gives FALSE.
Because they both point to the same object and they are equal so it gives FALSE.
Option d. &ptr1 == &ptr2 is not correct. Because ptr1 and ptr2 are pointers. So *ptr is value and ptr is address. & is used for normal variables. the pointer doesn't need &.
1. For the declarations below, which expression is TRUE if ptr1 and ptr2 point at the...
C++ 1. A?B?C?D? which one is correct 2. 3A, 3B #include<iostream> using namespace std; void swap0(int* ptri, int* ptr2) { int *temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap1(int ptri, int ptr2){ int temp; temp = ptri; ptr1 = ptr2; ptr2 = temp; portion void swap2(int *&ptri, int *&ptr2){ int* temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap3(int &ptri, int &ptr2) { int temp; temp = ptr1; ptr1 = ptr2; ptr2 =...
Question 5 (1 point) Using the following declarations, identify the scope that applies to the variables a, b, c and d. c nst b 1 a = true; void f (double b) char c for (int d = 0; d < 2; d++) cout << b << c << endl: 1. global 2. local
1. Consider the Viterbi algorithm. Which of the following statements is/are true. if any? (i) It is an algorithmused for optimal thresholding (ii) It is an algorithm to find shortest paths in on a network (ii)It is an algorithm to detect lines in images (a) (i) (b) (ii) (c) (ii) (d) All of the above (e) None of the above 4. If we apply a binary opening to the same object twice using the same structuring element, the effect. if...
plz solve 2 ,4,8,10 " << endl; acement display? Ans: answer= B. answer 2. cu int x = 2, y = 1; what will the following cout statement display? Ans: cout << "answer=" < (x || !y ) << endl; A. answer=0 B. answer=1 C. answer=2 D. None of these This code void ActivateBuzzer(int); is c A. to call a function B. function definition (C.)function declaration D. not valid Which option correctly describes the result of the following C/C++ code?...
Quiz Question 1 (1 point) Saved The maximum value for an int is: Question 1 options: 2147483647 65535 32767 9223372036854775804 Question 2 (1 point) A float has ____ decimal places of accuracy. Question 2 options: 15 none 7 3 Question 3 (1 point) It is a good practice to compare floats and doubles with ==. Question 3 options: True False Question 4 (1 point) Strings are reference data types. Question 4 options: True False Question 5 (1 point) Value data...
Which of the following is NOT true of the Rb protein? a. It inhibits gene expression by binding to a gene regulatory protein. b. In the absence of mitogen it promotes cell proliferation. c. Its activity is controlled by phosphorylation. d. It is a tumor suppressor protein. e. None of the above (= all of the above are true).
Which are invalid variable declarations that will cause compiler errors? a. int number$1 = 10; b. int number#1 = 10; c. int 21stJump = 10; d. int number_1 = 10; e. int Number1 = 10;
Problem - 1: For the following declarations below, indicate which of the following statements are valid or not 5 Points int At yAddst; long *dtAddst, ptAddst; double *ptZ int a long b; double c 1. yAddst =&a; 3. yAddst Atl 4, pt2=&a; 5, ptAddst &b: 2. yAddst =&c; Problem - 2: Consider Problem - 1 in HW-3 that calculates the value of the series e, sinx, cos r using functions. Now modify this C++ program to calculate the value of...
Not entirely sure what most of this means, help? Declarations and Initialization int a=1, b=2, c= 3; Value Expression Equivalent Expression
I have to type and explain in class each code in every detail filled with // commentary. Explains how does work in every codes. 1) What does the below print #include <iostream> using namespace std ; int main() { int var1 = 20 ; int var2 = 30 ; int* ptr1 ; int* ptr2 ; int* temp ; ptr1 = &var1 ; ptr2 = &var2 ; cout << *ptr1 << endl ;...