logo

Crowdly

Does this program always provoke a segmentation fault? #include <stdlib.h> ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Does this program always provoke a segmentation fault?

#include <stdlib.h>

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

  char *name;

  name = (char *) (malloc (20 * sizeof (char)));

  name[22] = 'h';

}

More questions like this

Want instant access to all verified answers on moodle.eurecom.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!