error LNK2001?

Pages: 12
This part is somewhat confusing? What exactly is an object? I never really understood what object orient is


Even though this is a simple question, it's extremely difficult to answer.

An easy way of thinking of objects in C++ is to think about objects in real life. Now, C++ objects don't always translate to real life perfectly, but objects from real life have properties and functions, just like C++ objects.

Let's take a real life toaster for example. It's an appliance, but you could say that it's an object. The toaster has certain properties (dimensions, weight, etc) and it has certain functions (you put bread in it, push the lever, and toast the bread).

C++ objects contain properties that are relevant to what you'll be doing with them. For instance, if I want to write a program which prints the "toast" status of a piece bread as it's being toasted, my toaster class wouldn't contain information such as "the weight of the toaster" or "the dimensions of the toaster". On the other hand, if I were writing a physics simulation, and I want to throw around a toaster, I would need to know those things, and I would write my toaster class accordingly.

Objects are abstract data types that hold data, just like any other data type. What makes them abstract is that they act as sort of an interface between programmer and the machine code it gets compiled into.
Topic archived. No new replies allowed.
Pages: 12