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
temporary-variable
:
Content language: Русский
English
Что будет выведено в результате выполнения кода: #include <iostream> int foo ( int & x ) { return x*3 ; } int foo ( int x ) { return x*2 ; } int main() { int intvar = 3 ; float floatvar = 10.84 ; std::cout << foo(2+intvar) << foo(floatvar) ; }
temporary-variable
что будет выведено на экран: #include <memory> #include <iostream> class SomeObj { public: SomeObj() : val_(std::make_shared<int>(10)) {} SomeObj(const int& val) : val_(std::make_shared<int>(val)) {} const int& operator*() const { return *val_; } int& operator*() { return *val_; } private: std::shared_ptr<int> val_; }; SomeObj getSomeObj(const int& i) { return SomeObj(i); } int main() { const int& v = *getSomeObj(100); std::cout << v; return 0; }
temporary-variable
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes