I'm trying to print escape characters as characters or strings using this code:
while((c = fgetc(fp))!= EOF)
{
if(c == '')
{
printf(" ");
}
else if(c == 'a')
{
printf(" a");
}
else if(c == '')
{
printf(" ");
}
else if(c == 'f')
{
printf(" f");
}
else if(c == '
')
{
printf("
");
}
else if(c == '
')
{
printf("
");
}
else if(c == '')
{
printf(" ");
}
else if(c == 'v')
{
printf(" v");
}
}
but when i try it, it actually prints the escape sequence.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…