Errors with C++ Variable Replication

After a spending a little bit of time, I managed to get everything down! The project now compiles without a hitch. Thanks a lot!