#include <iostream>
usingnamespace std;
int main()
{
int size=10;
char *p;
p=newchar [size];
char *q;
q=newchar [size];
q="Hello"; // If you want a pointer to a string literal you should
// have used a pointer of type const char*. This line is
// also a memory leak because you have no way to find
// the memory that q pointed to before, and therefore no
// way of deleting it.
cout<<*(q+1);
delete []p;
p=nullptr;
delete []q; // You are trying to delete a string literal. Only use
// delete on things that you created by using new.
q=nullptr;
return 0;
}