#include <stdio.h>#include<iostream>#include<math.h>using namespacestd;intMain () {//declaring character arrays and pointer variables Charstr[Ten]; Char*strip=str; //Input/Outputcout<<"str="; CIN>>str;//enter a string with a character arraycout<<"str="<<str<<Endl; cout<<"strip="<<strip<<Endl; cout<<"strip="; CIN>>strip;//enter a string with a character pointer variablecout<<"str="<<str<<Endl; cout<<"strip="<<strip<<Endl; //Change the contents of a pointer to a string by using the cursor variable* (strip+2)='L'; cout<<"str="<<str<<Endl; cout<<"strip="<<strip<<Endl; //dynamically allocating memory for character pointer variablesstrip=New Char( -); cout<<"strip="; CIN>>strip;//enter a string with a character pointer variablecout<<"str="<<str<<Endl; cout<<"strip="<<strip<<Endl; System ("Pause");}
About pointers with character arrays, character pointer variable input strings dynamically allocate memory for character pointer variables