Q:

The following assignment is illegal. Why? How would you correct it

0

The following assignment is illegal. Why? How would you correct it?

double dval; int ival; int *pi;
dval = ival = pi = 0;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

int main() {
  double dval;
  int ival;
  int *pi;
  //dval = ival = pi = 0;
  // the type of `pi` is `int *` which cannot be converted to `int`
  dval = ival  = 0;
  pi = 0;

  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now