I thought segmentation fault is coming due to memory leak so i modified the code a bit:
Still giving the segmentation fault, Sharing my code with you using CB IDE, Please clear:
I thought segmentation fault is coming due to memory leak so i modified the code a bit:
Still giving the segmentation fault, Sharing my code with you using CB IDE, Please clear:
Mistakes
to Print character array correct statement is
cout<<ptr<<endl;
cout<<*ptr<<endl: 
it will print only first character of array
and when ptr is null it will give run errror
see the modified code below
Modified Code
if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with
and don’t forgot to mark doubt as resolved
Thank you so much
Understood your point
