Discussion :: C++ - MCQs
-
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;
}
Answer : Option A
Explanation :
Pointer ptr points to string 'fg'. So it prints fg.
Be The First To Comment