-
February 3rd, 2012, 02:22 PM
#1
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?
-
February 3rd, 2012, 02:27 PM
#2
Re: dword
The value of &dwaveragesize is the address of dwaveragesize.
The value of dwaveragesize is according to your code snippet (dword)-1
Victor Nijegorodov
-
February 3rd, 2012, 02:31 PM
#3
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|