如何才能在该C拼图更换? [英] What to replace in this C Puzzle?

查看:142
本文介绍了如何才能在该C拼图更换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在这是一个愚蠢的难题,我从一些试卷了,可悲的是,我无法从最后15分钟看着办吧。

Now this is a silly puzzle I got from some exam paper,sadly I am unable to figure it out from last 15 minutes.

#include <stdio.h>

int main(void){

    /* <something> */    

      putchar(*(wer[1]+1));
   return 0;
 }

我们应该更换到位的东西,以获得输出电子。现在我们知道的putchar 需要一个 INT 作为参数,但是这code假定给予pointer.Does这个问题,即使是有效的吗?

What should we replace in place of something in order to get the output e.Now we know putchar takes a int as argument but this code assumes to give a pointer.Does this question is even valid ?

推荐答案

由于 A [I] 相同 *(A + I )的定义,可以将的putchar()参数为 WER [1] [1] 。所以,像的char * WER [2] 将是一个令人满意的定义,并使得的任何值WER [1] [1] ==' E'将工作。

Since a[i] is the same as *(a + i) by definition, you can transform the putchar() argument into wer[1][1]. So, something like char *wer[2] would be a satisfactory definition, and any values such that wer[1][1] == 'e' will work.

这篇关于如何才能在该C拼图更换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆