adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
        char *ptr;
        char Str[] = "abcdefg";
        ptr = Str;
        ptr += 5;
        cout << ptr;
        return 0;
    }

a.

fg

b.

cdef

c.

defg

d.

abcd

Answer: (a).fg

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?