Please explain why I get the segfault using the ++ operator. What is the difference between explicitly adding 1 and using the ++ operator ?
using namespace std;
#include <iostream>
int main() {
char* p = (char*) "hello";
cout << ++(*p) << endl; //segfault
cout << 1 + (*p) << endl; // prints 105 because 1 + 'h' = 105
}