tags:

views:

87

answers:

1
  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 
+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
for(i=0; (scanf("%s", stn.(numbers[i])))!=0; ++i) ; should I change " stn.(numbers[i]))"
gcc
@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
Yes, that as well as `stn.(the_lower_limit)` and `stn.(the_upper_limit)`.
BoltClock