I am running the below code. I am getting run time error.
#include <iostream>
using namespace std;
int main() {
    char *p="hello";
    //p="Hi";
    *p='G';
    cout<<*p;
    return 0;
}
if this is giving error then what is use of const char *p="hello";In this case my string should be constant not in char *p="hello"
 
     
    