logo

Crowdly

Computer systems

Looking for Computer systems test answers and solutions? Browse our comprehensive collection of verified answers for Computer systems at moodle.epfl.ch.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

On a 64 bits architecture, what does the following code print ?

const char* s = "123456";

printf("%zu\n", sizeof(s));

Note: "%zu" is indeed the correct way to print values of size_t type.

0%
0%
0%
100%
0%
0%
0%
View this question

What does the following code excerpt print?

int tab[] = { 2, 4, 6, 8, 10, 12 };

putchar('1');

int a = -1;

int* p = tab + 2;

while ((a = *p++) < 10) { printf("%d", a); }

0%
0%
0%
0%
0%
100%
0%
0%
View this question

Considering

double** tab;

and provided that enough memory has been allocated for 4 lines and 4 columns,

each of the same length (4), then

tab[2][0] always comes in memory right after tab[1][3].

0%
0%
100%
0%
0%
View this question

 What happens if a system crashes while writing data without crash consistency mechanisms?

100%
0%
0%
0%
View this question

Which statement(s) is/are TRUE regarding the structure of two-level indexing?

100%
0%
0%
100%
View this question

In a three-level indexing system, the first level contains pointers to the second-level index blocks, which in turn point directly to data blocks.

View this question

Multi-level indexing in a file system is used to manage large files efficiently by breaking index structures into multiple levels.

View this question

If you open a file and add some data to it, which of the following information may be updated in the file's inode?

100%
100%
100%
0%
0%
View this question

Consider the following five functions:

char* f1(char* s)

{

s += 5;

*s = 0;

return s;

}

char* f2(char* s1)

{

char* s2 = s1;

s2[5] = '\0';

return s1;

}

char* f3(char* s1)

{

char s2[5] = s1;

return s2;

}

char* f4(char* s)

{

return strstr(s, "Hello");

}

char* f5(char* s1)

{

char* s2 = NULL;

strncpy(s2, s1, 5);

return s2;

}

and consider the following variable:

char string[] = "Hello world!";

For each of the functions, choose the appropriate statement when called on string.

View this question

Consider the following variable:

char* s1 = "Hello";

Tick each of the following statements which are incorrect (considered separately).

Penalty for wrong ticks.

0%
0%
100%
100%
100%
0%
100%
View this question

Want instant access to all verified answers on moodle.epfl.ch?

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