Just got that book, copypasted and it worked. What error do you have? Post code here, maybe you did something wrong. Here is code I copied on Ideone: http://ideone.com/HsgTEZ
Are you sure you did it corrrectly? Because I found the different copies of the book and every one contained same code which worked perfectly. I use C::B with MinGW compiler too.