✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
The following program has a memory allocation issue. At which loop index will our program generate a segmentation fault?
#include <stdlib.h>#include <stdio.h>int main(int argc, char ** argv) { char *name; long long i; name = (char *) (malloc (20 * sizeof (char))); for(i=0; i>-1; i++) { name[i] = (char)i; printf("i=%lld\n", i); } }
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!