-
dword
hi,
there have been few exercises by myself to enter cpp because of limitation of books i stumbled upon
please answer me a question on the following exercise from msdn
main(){
dword dwaveragesize;
...
dwaveragesize=(dword)-1;
createmmio(hmmio, &dwaveragesize,0);
...
}
what is value in &dwaveragesize before using it in this multimedia function?
-
Re: dword
The value of &dwaveragesize is the address of dwaveragesize.
The value of dwaveragesize is according to your code snippet (dword)-1
-
Re: dword
'&' takes the address of the variable which is whatever the environment assigns. You are passing the address of the variable to the function, which will presumably modify that variable so that it is changed when main continues. The initial value of the variable is unspecified and could be anything. Then you make an assignment of (-1). The value of the address is not something that a programmer needs to worry about. The important thing is that you understand what is happening in the program.