Hi, guys~
I found the code below when reading some documents.
and it says: the Number referred to in AddFive is a copy of the variable nMyNumber passed to the function, not the variable itself.
I am at a loss this moment,any ideas to me plz ?
#include <stdio.h>
void AddFive(int Number)
{
Number = Number + 5;
}
void main()
{
int nMyNumber = 18;
printf("My original number is %d\n", nMyNumber);
AddFive(nMyNumber);
printf("My new number is %d\n", nMyNumber);
}



LinkBack URL
About LinkBacks
any ideas to me plz ?



I used to be an adventurer like you... then I took an arrow to the knee.