Differences
I am stuck on why *("Harry" + 2 ) and "Harry"[3] have the same output (r) but "Harry" + 1 output is (arry). What are the differences
1 2 3 4 5
|
cout << "Harry" + 1 << endl;
cout << *("Harry" + 2 ) << endl;
cout << "Harry"[3] << endl;
cout << endl;
|
The difference is that the first cout is a pointer while the other are not.
Topic archived. No new replies allowed.