Hello, i know some of the basic stuff about references...but what's going on here:
When i call foo function, does it push its arguments onto the stack? What is the layout of a stack frame? What is the difference between pass by reference and pass by a pointer?Code:#include<iostream> using namespace std; void foo(int& aa,int& bb){ aa=0; bb=0; } int main(){ int a(1); int b(1); foo(a,b); cout<<a<<" "<<b<<endl; return 0; }
I read somewhere that there are no references to references, but i compile this:
Code:#include<iostream> using namespace std; int main(){ int a(0); int& b=a; int& c=b; return 0; }
Thanks



7Likes
LinkBack URL
About LinkBacks



