logo

Crowdly

Check all the true claims about the execution of the C code provided below. --...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

Check all the true claims about the execution of the C code provided below.

--

#include <stdlib.h>

#include <string.h>

#include <stdio.h>

int funnyAllocation(char *buf, int b) {

  buf = (char *) ( malloc(sizeof(char) * 5));

  strcpy(buf, "hello");

  return 7;

}

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

  int b = 3;

  char *buf = (char *) ( malloc(sizeof(char) * 5));

 

  int returned = funnyAllocation(buf, b);

  printf("The content of buf is: %s\n", buf);

}

100%
100%
0%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.eurecom.fr?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!