I have a special character called �. When it is declared as a character variable its showing it can be printed. But when it is declared as a character pointer variable its showing it cannot be printed. I am just wondering why its happening like this..
c1 = '@';
c2 = '�';
char *fp;
fp="XX�";
if ( isprint(c1) )
printf ("%c can be printed \n ", c1);
else
printf ("%c cannot be printed \n ", c1);
if ( isprint(c2) )
printf ("%c can be printed \n ", c2);
else
printf ("%c cannot be printed \n ", c2);
while (*fp){
if ( isprint(*fp)) )
{
printf ("%s can be printed \n ", fp);
fp++;
}
else
{
printf ("%s cannot be printed \n ", fp);
fp++;
}
}
This is my sample code...If I remove the pointer declaration and print the character alone its showing it can be printed. If I include the pointer declaration and try to print it from the pointer its showing it cannot be printed.,..please advise on this..