What will be printed during execution:

#include <iostream>

int main()
    int x[] = {3,5,8} ;
    std::cout << (*x)["my string"+3] ;
Will be printed "i".
Dereferencing of "x" will give the value "x[0] == 3".
"my string" will be converted to a const pointer to a given string.
We will get the following: 3[pointer+3]
This expression, according to the language rules, will be converted to *(3+pointer+3).
Thereby in brackets,​ we will get the offset on 6 symbols in the string "my string" and while dereferencing will get const char with value "i"

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Зарегистрируйся сейчас
или Подпишись на будущие тесты