You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Regarding the point in the yellow box, keep in mind arguments passed by reference (with a pointer) WILL change if they're modified in the function. For example:
#include <iostream>
using namespace std;
void printSomething(int * x) {
*x = *x + 1;
cout << *x << endl;
}
int main() {
int x = 42;
int* px = &x;
printSomething(px);
cout << x << endl;
}
//In the example above, both couts will display 43