logo

Crowdly

Browser

Add to Chrome

#include <stdio.h> #include <string.h> #include <stdlib.h> int main...

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

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

int main(void) {

  struct MonStruct {

    int n;

    char * ch;

  };

  struct MonStruct * a, b;

  a = malloc(sizeof(struct MonStruct));

  a->n = 30;

  a->ch = malloc(strlen("abcabc")+1);

  strcpy(a->ch, "abcabc");

  printf("%d ", a->n);

  printf("%s ", a->ch);

  b = malloc(sizeof(struct MonStruct));

  b->n = 0;

  b->ch = (char*) malloc(sizeof(strlen("bcabca")));

  strcpy(b->ch, "bcabca");

  printf("%d ", b->n);

  printf("%s \n", b->ch);

  return (0);

}

Qu'affiche le programme suivant ?

More questions like this

Want instant access to all verified answers on moodle.insa-toulouse.fr?

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

Browser

Add to Chrome