If you post the code in your beretta.cpp file, I might be able to locate some the errors. But I would recommend you learn how to do object-oriented C++ first, because the SDK code uses it a lot. You need to learn more about C++ programming if you want to make progress.
There is a good introduction here:
http://www.cplusplus.com/doc/tutorial/You should read them all (and also write simple some code yourself so you can experience it yourself), but if you want to skip some, the most important sections you should read are:
- Basics: "Variables and types" and "Operators"
- Program structure: "Control Structures" and "Functions"
- Compound data types: "Arrays" and "Pointers"
- Classes: Everything