stored_name_t scan_construct_struct(void)
{ stored_name_t stn; int i=0;
scanf("%c %lf %lf",&(stn.name)
,&(stn.(the_lower_limit))
,&(stn.(the_upper_limit)));
for(i=0; (scanf("%s", stn.(numbers[i])))!=0; ++i)
;
return stn;
}
dene.c:37: error: expected identifier before ‘(’ token
and
there is an one more error but I cannot see
views:
87answers:
1
+6
A:
stn.(the_lower_limit)
- what is that supposed to mean? In C language the right-hand side of member access operator .
cannot be taken into ()
. It is not a subexpression. You refer to stn.name
correctly. Why on Earth did you decide to add these ()
around all other member names?
AndreyT
2010-06-05 07:24:56
for(i=0; (scanf("%s", stn.(numbers[i])))!=0; ++i) ; should I change " stn.(numbers[i]))"
gcc
2010-06-05 07:27:21
@gcc: You should get rid of all `()` after each `.` operator. That at least will make it compile. Still, your code is overloaded with redundant `()`.
AndreyT
2010-06-05 07:28:01
Yes, that as well as `stn.(the_lower_limit)` and `stn.(the_upper_limit)`.
BoltClock
2010-06-05 07:28:26