My C Quiz

The ultimate place to learn C!

Question #12: For the code below which lines should be reported as errors by a compiler?

int main(int argc, char** argv){

  const char* foo = "wow";           // line 1
  foo = "top";                       // line 2
  foo[0] = 1;                        // line 3

  return 0;
}