解释奇怪的输出''

问题描述 投票:-3回答:1

我已经用C语言编写了代码,

#include<stdio.h>

int main(void)
{
    char c[]="Suck It Big";
    char *p=c;
    printf("%c\n",p);
    printf("%c\n",p[3]);
    printf("%c\n",++p);
    printf("%d\n",p);
    printf("%d\n",p[3]);
}

我得到的此代码的输出是:Output

我在输出的第1行和第3行中复制了奇怪的字符,并将其粘贴到编辑器中得到了这个“ DLE”。谁能解释这个意思。

c output ascii non-ascii-characters
1个回答
1
投票

您使用的所有printf()调用均不正确,但第二个调用除外,因为相对参数或所使用的转换说明符是错误的。

© www.soinside.com 2019 - 2024. All rights reserved.