logo

Crowdly

Browser

Додати до Chrome

Consider the following function: void incr(char** ptr) { ++ptr; } and the...

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

Consider the following function:

void incr(char** ptr)

{

++ptr;

}

and the following code excerpt (i.e a part of a code that is elsewhere correct),

where you have to add two instructions, one for u and one for v:

char msg[] = "CS-202";

char* tab[] = { msg + 1, msg + 3 };

char* p = msg + sizeof(msg) - 1;

char** u = tab;

char** v = &p;

incr(u);

// add one statement on u

// add one statement on v

for (char* r = *u; r < *v; ++r) putchar(*r);

What should be added (one instruction for u and one instruction for v) so that the above code prints "20"?

Penalty for wrong ticks.

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

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

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

Browser

Додати до Chrome