How do i print escape characters as characters?

前端 未结 4 1692
花落未央
花落未央 2020-12-20 02:32

I\'m trying to print escape characters as characters or strings using this code:

while((c = fgetc(fp))!= EOF)
{
    if(c == \'\\0\')
    {
        printf(\"          


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-20 03:10

    If you want to escape %d within printf to allow you to actually print the characters "%d":

    printf("%%d"); 
    

提交回复
热议问题