How do i print escape characters as characters?

前端 未结 4 850
闹比i
闹比i 2020-12-20 02:17

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 02:53

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

    printf("%%d"); 
    

提交回复
热议问题