One of the most important, if not THE most important, differences between C++ and Pascal is that C++ is an Object-Oriented Language. Object-Oriented Languages allow you to organize your code in a more intuitive way than you can in other languages. The main principle in an object-oriented language is that you can create objects which hold data and the methods to manipulate and extract that data. Also, you can decide how visible to make those methods and data to the rest of your program. In C++, these objects are implemented using classes. Classes are very similar in syntax to structs. Here is an example of how to declare a class in C++: class Salsa { / Methods and data go here }; Notice that the class declaration is marked off by a { and a }, like a struct or any other block in C++. Another important things to notice is that the } is followed by a semicolon. Without that semicolon, most compilers will go bezerk (like a nacho-deprived man) and create all sorts of odd looking errors. |