Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
return reference (msvc)
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> const int& func() { int a=10; return a; } void func2(int v) { std::cout<<"function: "<<v<<std::endl; } int stackFunc() { int a1 = 15; int a2 = a1; int a3 = a2; return a3; } int main() { // Моментальное использование int b = func(); std::cout << "b: " << b << std::endl; const int& ra = func(); std::cout << "ra: " << ra << std::endl; const int& ra2 = func(); int aa = ra2; std::cout << "aa: " << aa << std::endl; // Действия со стеком const int& ra3 = func(); stackFunc(); int stack = ra3; std::cout << "stack: " << stack << std::endl; // Вызов функции func2(func()); }
run
|
edit
|
history
|
help
0
Temp 1
not a parameter pack
hangman
parantheses matching test 1
std::is_same doesn't check for calling convention
program_solution_3
#8
Buggy Strcat
Copy_and_base
#32