ExamVeda
Login
Home
91
Which of the following operator(s) can be used with pointers?
i. – only
ii. +, *
iii. +, –
iv. +, -, *
v. /
vi. + only
Discuss
Answer & Solution
Answer: Option A
Solution:
Explanation:
Pointers in C++ are variables that hold memory addresses. They're like street addresses that tell you where a house (data) is located.
We use special operators to work with these memory addresses.

+ (Addition): We can add a number to a pointer to move it to a different memory location. Imagine walking a few houses down the street.
- (Subtraction): Similarly, we can subtract to move backward in memory (go back a few houses).
* (Dereference): This is the most important pointer operator. It lets us access the data stored at the memory address held by the pointer. Think of it like going inside the house to see what's there.

The division operator (/) is not directly used with pointers in the same way as addition, subtraction, or dereference.

Therefore, the correct options are addition (+), subtraction (-), and dereference (*).

So the answer is (D) iv
92
Which of the following is correct about this pointer in C++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
93
Which of the following syntax for declaring a variable of struct STRUCT can be used in both C and C++?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
94
What happens if the following program is executed in C and C++?
#include <stdio.h> 
void func()
{
	printf("Hello");
}
void main() 
{ 
	func();
	func(2);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
95
Which of the following is correct?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
96
Which of the following is correct in C++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
97
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class Point
{
    int x, y;
  public:
   Point(int i = 0, int j =0)
   { x = i; y = j;  }
   int getX() const { return x; }
   int getY() {return y;}
};
 
int main()
{
    const Point t;
    cout << t.getX() << " ";
    cout << t.gety();
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
98
Which of the following escape sequence represents tab?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
99
What is the other name of run-time polymorphism?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
100
Which function is used to write a single character to console in C++?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board