【发布时间】:2017-08-24 11:56:46
【问题描述】:
我有这个代码:
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
void ft_ultimate_ft(int *********nbr)
{
printf("%d", *********nbr);
}
int main(){
/*Start of problem*/
int *a;
int **b = &a;
int ***c = &b;
int ****d = &c;
int *****e = &d;
int ******f = &e;
int *******g = &f;
int ********h = &g;
int *********i = &h;
/*end of problem*/
*********i = 42;
ft_ultimate_ft(i);
return 0;
}
我需要在循环中包含指向指针的声明(例如,while)。需要减少声明的数量。
【问题讨论】:
-
这是什么?谁提出了这个要求?
-
为什么要这样做?无论如何,你可以循环值,而不是类型。
-
您完全不担心
a是不确定的,因此车轮完全从您乘坐的马车上掉下来了? -
您不能循环执行此操作。星号的数量是类型的一部分,这个概念只存在于编译期间。
标签: c loops pointers while-loop