Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

calling by reference c++

void fun2(int& a) 
{
    a = 5;
}

int main()
{
    int b = 10;
    fun2(b); 

    // now b = 5;
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #calling #reference
ADD COMMENT
Topic
Name
2+2 =