This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setVarToOne(int* mVar){ | |
if(mVar) *mVar = 1; | |
} | |
std::srand(time(0)); | |
int mVar = 0; | |
setVarToOne(&mVar); | |
ASSERTEQ(mVar,1); //true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int mVar = 0; | |
void setVarToOne(int* mVar){ | |
if(mVar) *mVar = 1; | |
} | |
setVarToOne(&mVar); | |
ASSERTEQ(mVar,1); //true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int mVar = 0; | |
void setVarToOne(int* mVar){ | |
if(mVar) *mVar = 1; | |
} | |
setVarToOne(nullptr); | |
ASSERTEQ(mVar,0); //true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mVar = 0; | |
function setVarToOne(mVar){ | |
mVar = 1; | |
} | |
setVarToOne(undefined); | |
ASSERTEQ(mVar,0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int mVar = 0; | |
void setVarToOne(){ | |
mVar++; | |
} | |
setVarToOne(); | |
ASSERTEQ(mVar,1); // true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am jonluca on github. | |
* I am jonluca (https://keybase.io/jonluca) on keybase. | |
* I have a public key ASDsjXLhDp24xm9FCMS0jqWhF81R4Zd5Uz1ii5QzCHxingo | |
To claim this, I am signing this object: |
NewerOlder