Which lines contain errors (compilation errors, runtime errors, undefined behavior etc.), if any?
    char a[] = "123";  //1
    char b[5] = "123";  //2
    const char *c = "123";  //3
    a[3] = '3';  //4
    b[4] = '3';  //5
    c[2] = '5';  //6
Explanation
Pointer c points out to the constant memory area that stores the line literal "123". Therefore, a compilation error will occur in line 6 while trying to write to the constant memory area.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести