E
Ersek, Laszlo
Hi,
given the following code,
#include <stdio.h>
static int *
ip_incr(int id, int **i)
{
(void)fprintf(stdout, "%d\n", id);
return ++*i;
}
int main(void)
{
int x[4] = { 0 },
*a = x,
*b = x + 1,
*c = x + 2;
*ip_incr(1, &a) = *ip_incr(2, &b) = *ip_incr(3, &c) = 7;
(void)fprintf(stdout, "%d %d %d %d\n", x[0], x[1], x[2], x[3]);
return 0;
}
am I right to think that the program is well defined, and that the output
is (provided no output error occurs)
----v----
A
B
C
0 7 7 7
----^----
where [ABC] is any permutation of [123]?
Thanks,
lacos
given the following code,
#include <stdio.h>
static int *
ip_incr(int id, int **i)
{
(void)fprintf(stdout, "%d\n", id);
return ++*i;
}
int main(void)
{
int x[4] = { 0 },
*a = x,
*b = x + 1,
*c = x + 2;
*ip_incr(1, &a) = *ip_incr(2, &b) = *ip_incr(3, &c) = 7;
(void)fprintf(stdout, "%d %d %d %d\n", x[0], x[1], x[2], x[3]);
return 0;
}
am I right to think that the program is well defined, and that the output
is (provided no output error occurs)
----v----
A
B
C
0 7 7 7
----^----
where [ABC] is any permutation of [123]?
Thanks,
lacos