Hello! I have the following question.
I have this code:
1 2 3 4 5
int main()
{
unsignedint *dWords = NULL;
return 0;
}
I want to change the value of dWords via another function by passing it to the function as a parameter, so i can use its(dWords) new value so I can passed this new value to another function in main something like this.
1 2 3 4 5 6 7
int main()
{
unsignedint *dWords = NULL;
changedWords(dWords); // from here i need the dWords value to be changed
usedWordsNewValueForSomethingElse(dWords);//so I can use it here
return 0;
}
well, if, for example, you wanted to change an int you would have to pass it by pointer or reference. so if you want to change int* pass it by pointer (int**) of by reference (int*&).
example: