您的位置:首页 > 其它

你知道以下程序的输出吗?

2012-04-26 17:46 211 查看
#include "stdio.h"

main()
{
char ch[]="aehi";
char *pch=ch,*p,*t,*q,*m;

m=p=t=q=pch;

printf("%p ",pch);

printf("\n");
printf("%p ",p);
printf("%c ",*(p+1));
printf("%p ",p);

printf("\n");
printf("%p ",m);
printf("%c ",*m++);
printf("%p ",m);

printf("\n");
printf("%p ",t);
printf("%c ",*++t);
printf("%p ",t);

printf("\n");
printf("%p ",q);
printf("%c ",++*q);
printf("%p ",q);

printf("\n");

printf("%s",ch);
}


#include "stdio.h"
main()
{
int j,i=2;
i++,i++,j=i++;
printf("%d\n",j);
printf("%d\n",i);
}


#include "stdio.h"

main()
{
int i=10;
i=i-- - --i*(i=-3)*i++ + ++i;
printf("%d \n",i);
}


#include "stdio.h"

int f()
{
static int i=1;

return(++i);
}
main()
{
int j;

j=f()-f()*f();
printf("%d",j);
}


#include "stdio.h"

main()
{
int i;
unsigned int j;

i=-1;
j= (~0);

if(i==j)
printf("EQU.");
else
printf("Not EQU.");
}


#include "stdio.h"

main()
{
int i,j,k;
i=0;
j=1;
k=2;

if( i&&++j)
printf("%d,",j);
printf("%d,",j);

if( k||++j)
printf("%d",j);
printf("%d,",j);
}


#include "stdio.h"

main()
{
printf("%x \n",(2<<-1));
printf("%x \n",(2<<-2));
printf("%x \n",(2<<-3));

printf("%x \n",(4<<-1));
printf("%x \n",(4<<-2));
printf("%x \n",(4<<-3));

printf("%x \n",(1<<4));
printf("%x \n",(-1<<-4));
printf("%x \n",(-1<<4));
}


#include <stdio.h>
main()
{
printf("%d",sizeof"A");
printf("%d",sizeof'A');
}


#include <stdio.h>
int olddef(float d,char i);
//int newdef(float d,char i);
main()
{
float d = 10.0;
char j = 3;
int  i=1020;

olddef(d,j);

newdef(d,j);
}

olddef(d,i)
float d;
char  i;
{
printf("olddef: float = %f,char = %x \n",d,i);
}

newdef(float d,char i)
{
printf("new: float = %f,char = %x \n",d,i);
}


#include "stdio.h"

void main()
{

int a;
a=/*/*/0*/**/1;

printf("%d",a);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐