Шукаєте відповіді та рішення тестів для Computer systems? Перегляньте нашу велику колекцію перевірених відповідей для Computer systems в moodle.epfl.ch.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
Consider the following C program:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double* f(double* q) {
q = malloc(sizeof(double));
*q = log(3.0); // 1.098612
return q;
}
int main(void) {
double x = 9.8;
double* ptr1 = &x;
double* ptr2 = f(ptr1);
printf("%f\n", *ptr2);
free(ptr1);
return 0;
}
Tick all the correct statements.Penalty for wrong ticks.
Consider the following C program:
#include <stdio.h>
#include <stdlib.h>
void f(int* q) {
q = malloc(sizeof(int));
*q = 45;
}
int main(void) {
int i = 3;
int* ptr = &i;
f(ptr);
printf("%d %d\n", i, *ptr);
return 0;
}
Tick all the correct statements.Penalty for wrong ticks.
Why might an end-system send an Address Resolution Protocol (ARP) message?
(Many answers may apply.)
In which case(s) does a link-layer switch broadcast a packet?
(Many answers may apply.)
Which of the following statements about forwarding tables are true?
Which of the following statements about IP forwarding tables are true?
(Many may be true.)
Which of the following statements about the Address Resolution Protocol (ARP) are true?
(Many may be true.)
What would happen if IP addresses were flat, hence not location-dependent?
Which of the following statements about MAC addresses are true?
Based on what we said in class, which of the following statements are true?
(Many may be true.)