Vidyalelo
C++ Programming · Q50

Pointers and References in C++

Programming · C++ Programming · question 50

Q50

What will be the output of the following C++ code? #include using namespace std; int main() char *ptr; char Str[] = "abcdefg"; ptr = Str; ptr += 5; cout << ptr; return 0;

A.
fg
Answer
B.
cdef
C.
defg
D.
abcd

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board