I'm just going on what this text book is teaching me for now. But i'm glad i found this board to let me see whats in store for me. I looked up the for loop and looked like it was around chapter 11 when im only on chapter 8, which is currently Scopes, Lifetime, and More about functions.
Hey, I wish you the best of luck learning the language. And I'm happy for you that you solved your problem. Sometimes those books can get ahead of themselves though. I've read a few C++ books and the best learning source I've found so far for me was this site.