## C (Programming Language)

Score %0 (0 correct0 incorrect83 unanswered)

Quiz only available in:English

Q1. Which Code sample will eventually cause the computer to run out of memory?

  • :
while(1)
{
    char *smallString = (char *) malloc(10);
}
  • :
long long number = 1;
    while(1)
    number *= 2;
  • :
while(1)
{
    char hugeString[1000000L];
    memset(hugeString, 0, 1000000L);
}
  • :
while(1)
{
    long *bigArray = (long *) malloc(sizeof(long) * 1000);
    memset(bigArray, 1000000, 1000);
    free(bigArray);
}
1 of 83