Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
preprocessor directives
:
Content language: Русский
English
В каких строчках кода содержатся ошибки? int main() { #define MyConst 1 int k = MyConst + 1; //1 #undef MyConst //2 k += MyConst; //3 #define MyConst 2 //4 k = MyConst++; //5 return 0; }
preprocessor directives
Когда выполняются директивы препроцессора?
preprocessor directives
Чему равно значение переменной res ? #define F(x) (2*x*x) int main() { int a = 1, b = 2; int res = F(a + b); return 0; }
preprocessor directives
#include <iostream> int main() { #define MyConst 1; #define Debug int k = 10; #if !defined Debug && defined MyConst k++; #endif std::cout<<k; return 0; } Что будет выведено на экран?
preprocessor directives
Из за чего код не скомпилируется?: using Systеm; nаmеsрасе Q { сlаss Sample { /*1*/ #rеgiоn Cоnstruсtоr рubliс Sample(string sample) { } /*2*/ #еndrеgiоn /*3*/ #rеgiоn Рrореrtiеs рubliс string Nаmе { sеt; gеt; } /*4*/ #еndrеgiоn /*5*/ #rеgiоn Меthоds stаtiс vоid Маin(string[] аrgs) { /*6*/ Sample n = nеw Sample("Hеlо Wrоld"); } /*7*/ #еndrеgiоn } }
preprocessor directives
Что будет выведено в результате работы программы? #if DEBUG Console.WriteLine("DEBUG"); #else Console.WriteLine("RELEASE"); #endif
preprocessor directives
Дано определение макроса SQUARE. Какое значение будет выведено на экран в результате выполнения следующего кода: #define SQUARE(x) ((x)*(x)) int m = 4; SQUARE(++m); std::cout << r;
preprocessor directives
Для даного определения макроса, что будет выведено на экран? #define Some_operation(x, y) ((x) + (y) - 1) / (y) int main() { std::cout<< sizeof Some_operation(1,2); }
preprocessor directives
Возникнут ли ошибки при компиляции?
preprocessor directives
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes