logo

Crowdly

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

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

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%
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!