Q:

Which, if any, of the following names are invalid

0

Which, if any, of the following names are invalid?

(a) int double = 3.14;
(b) int _;
(c) int catch-22;
(d) int 1_or_2 = 1;
(e) double Double = 3.14;

All Answers

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

int _;  // Error: start with `_` (May not warn by compiler)
int main() {
  //int double = 3.14;  // Error: reserved key word
  int _;  // OK
  //int catch-22;  // Error: `-` in name
  //int 1_or_2 = 1;  // Error: start with number
  double Double = 3.14;  // OK

  int _i2;  // OK

  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