If statement question

I was reading through some code that dealt with opening a .wav and reading out the data. I came across this snippet. The author commented what was going on in this section. I'm confused about how this if statement actual works. Could someone walk me through it. Seems like it's calling a function and checking its return value with the "if" statement all at the same time.

1
2
3
4
5
6
7
/*   Open the file for reading with buffered I/O. Let windows use its default internal buffer */

if (NULL == (h->hMmio = mmioOpen( (LPTSTR) szFileName, NULL, MMIO_READ | MMIO_ALLOCBUF | MMIO_DENYWRITE)))
	{
		/*   Oops, file doesn't exist or access denied! */
		goto error;
	}

It's equivalent to this:
1
2
3
h->hMmio = mmioOpen(/*...*/);
if (h->hMmio == NULL){
    //... 

Remember that x=y evaluates to y, so for instance (x=y+1)+2 evaluates to y+3.
@helios:
Thanks for the quick reply. I'm going to have to read through what you wrote a few times for it to actually sink in.
Topic archived. No new replies allowed.