SnoreLax,
Putting a .cpp file on the robot will not result in a function program because the code must be compiled first. I would assume since you are doing C++ development you are using RobotC. You should be able to compile and deploy your C++ code to your NXT from within RobotC.
Cheers,
Mark
Mark
NI App Software R&D