You must initialize your data in the beginning of the function. I have tested it in the compiler environment VS2010.